Modifications to allow us to find the configuration folder even when executing on a drive rather than the install drive.

This commit is contained in:
Juan Carlos Luciani 2006-08-14 20:16:03 +00:00
parent f6106fcd67
commit 14a164564b
2 changed files with 27 additions and 5 deletions

View File

@ -25,8 +25,12 @@
//===[ Include files ]=====================================================
#include "internal.h"
#include <shlobj.h>
#include <shlwapi.h>
//===[ External data ]=====================================================
extern
char mechConfigFolderPartialPath[];
//===[ Manifest constants ]================================================
@ -57,6 +61,15 @@ BOOL APIENTRY DllMain(
{
g_hModule = hModule;
// Setup the path to the auth mechanisms config folder
if (SHGetFolderPath(NULL,
CSIDL_PROGRAM_FILES,
NULL,
0,
mechConfigFolder) == 0)
{
PathAppend(mechConfigFolder, mechConfigFolderPartialPath);
// Initialize the library
if (Initialize() != 0)
{
@ -64,6 +77,14 @@ BOOL APIENTRY DllMain(
OutputDebugString("CASAAUTH -DllMain- Library initialization failed\n");
retStatus = FALSE;
}
}
else
{
// Failed to obtain the Program Files path
OutputDebugString("CASAAUTH -DllMain- Failed to obtain the Program Files path\n");
retStatus = FALSE;
}
break;
}

View File

@ -54,7 +54,8 @@ static
HANDLE hNormalizedHostNameCacheMutex;
// Authentication mechanism configuration file folder
char mechConfigFolder[] = "\\Program Files\\Novell\\Casa\\Etc\\Auth\\Mechanisms";
char mechConfigFolder[MAX_PATH];
char mechConfigFolderPartialPath[] = "Novell\\Casa\\Etc\\Auth\\Mechanisms";
// Synchronization mutex for the dll initialization
static