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 files ]===================================================== | ||||||
|  |  | ||||||
| #include "internal.h" | #include "internal.h" | ||||||
|  | #include <shlobj.h> | ||||||
|  | #include <shlwapi.h> | ||||||
|  |  | ||||||
| //===[ External data ]===================================================== | //===[ External data ]===================================================== | ||||||
|  | extern | ||||||
|  | char  mechConfigFolderPartialPath[]; | ||||||
|  |  | ||||||
| //===[ Manifest constants ]================================================ | //===[ Manifest constants ]================================================ | ||||||
|  |  | ||||||
| @@ -57,6 +61,15 @@ BOOL APIENTRY DllMain( | |||||||
|       { |       { | ||||||
|          g_hModule = hModule; |          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 |             // Initialize the library | ||||||
|             if (Initialize() != 0) |             if (Initialize() != 0) | ||||||
|             { |             { | ||||||
| @@ -64,6 +77,14 @@ BOOL APIENTRY DllMain( | |||||||
|                OutputDebugString("CASAAUTH -DllMain- Library initialization failed\n"); |                OutputDebugString("CASAAUTH -DllMain- Library initialization failed\n"); | ||||||
|                retStatus = FALSE; |                retStatus = FALSE; | ||||||
|             } |             } | ||||||
|  |          } | ||||||
|  |          else | ||||||
|  |          { | ||||||
|  |             // Failed to obtain the Program Files path | ||||||
|  |             OutputDebugString("CASAAUTH -DllMain- Failed to obtain the Program Files path\n"); | ||||||
|  |             retStatus = FALSE; | ||||||
|  |          } | ||||||
|  |  | ||||||
|          break; |          break; | ||||||
|       } |       } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -54,7 +54,8 @@ static | |||||||
| HANDLE   hNormalizedHostNameCacheMutex; | HANDLE   hNormalizedHostNameCacheMutex; | ||||||
|  |  | ||||||
| // Authentication mechanism configuration file folder | // 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 | // Synchronization mutex for the dll initialization | ||||||
| static | static | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user