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:
		| @@ -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; | ||||
|       } | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user