diff --git a/CASA-auth-token/non-java/client/windows/dllsup.c b/CASA-auth-token/non-java/client/windows/dllsup.c index c30b3cb2..9a50c46d 100644 --- a/CASA-auth-token/non-java/client/windows/dllsup.c +++ b/CASA-auth-token/non-java/client/windows/dllsup.c @@ -25,8 +25,12 @@ //===[ Include files ]===================================================== #include "internal.h" +#include +#include //===[ External data ]===================================================== +extern +char mechConfigFolderPartialPath[]; //===[ Manifest constants ]================================================ @@ -57,13 +61,30 @@ BOOL APIENTRY DllMain( { g_hModule = hModule; - // Initialize the library - if (Initialize() != 0) + // Setup the path to the auth mechanisms config folder + if (SHGetFolderPath(NULL, + CSIDL_PROGRAM_FILES, + NULL, + 0, + mechConfigFolder) == 0) { - // Failed to initialize the library - OutputDebugString("CASAAUTH -DllMain- Library initialization failed\n"); + PathAppend(mechConfigFolder, mechConfigFolderPartialPath); + + // Initialize the library + if (Initialize() != 0) + { + // Failed to initialize the library + 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; } diff --git a/CASA-auth-token/non-java/client/windows/platform.c b/CASA-auth-token/non-java/client/windows/platform.c index 1003ece0..2c83eb1c 100644 --- a/CASA-auth-token/non-java/client/windows/platform.c +++ b/CASA-auth-token/non-java/client/windows/platform.c @@ -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