Changeset 55017 in vbox for trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
- Timestamp:
- Mar 31, 2015 7:20:36 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
r55007 r55017 1909 1909 * Loads a module in the system32 directory. 1910 1910 * 1911 * @returns Module handle on success. Won't return on fa liure.1911 * @returns Module handle on success. Won't return on failure if fMandatory = true. 1912 1912 * @param pszName The name of the DLL to load. 1913 */ 1914 DECLHIDDEN(HMODULE) supR3HardenedWinLoadSystem32Dll(const char *pszName) 1913 * @param fMandatory Whether the library is mandatory. 1914 */ 1915 DECLHIDDEN(HMODULE) supR3HardenedWinLoadSystem32Dll(const char *pszName, bool fMandatory) 1915 1916 { 1916 1917 WCHAR wszName[200+60]; … … 1931 1932 hMod = LoadLibraryExW(wszName, NULL, fFlags); 1932 1933 } 1933 if (hMod == NULL) 1934 if ( hMod == NULL 1935 && fMandatory) 1934 1936 supR3HardenedFatal("Error loading '%s': %u [%ls]", pszName, RtlGetLastWin32Error(), wszName); 1935 1937 return hMod; … … 1950 1952 * Load crypt32.dll and resolve the APIs we need. 1951 1953 */ 1952 HMODULE hCrypt32 = supR3HardenedWinLoadSystem32Dll("crypt32.dll" );1954 HMODULE hCrypt32 = supR3HardenedWinLoadSystem32Dll("crypt32.dll", true /*fMandatory*/); 1953 1955 1954 1956 #define RESOLVE_CRYPT32_API(a_Name, a_pfnType) \ … … 2056 2058 * Resolve the imports we need. 2057 2059 */ 2058 HMODULE hWintrust = supR3HardenedWinLoadSystem32Dll("Wintrust.dll" );2060 HMODULE hWintrust = supR3HardenedWinLoadSystem32Dll("Wintrust.dll", true /*fMandatory*/); 2059 2061 #define RESOLVE_CRYPT_API(a_Name, a_pfnType, a_uMinWinVer) \ 2060 2062 do { \ … … 2083 2085 * make sure the providers are cached for later us. Avoid recursion issues. 2084 2086 */ 2085 HMODULE hBCrypt = supR3HardenedWinLoadSystem32Dll("bcrypt.dll" );2087 HMODULE hBCrypt = supR3HardenedWinLoadSystem32Dll("bcrypt.dll", false /*fMandatory*/); 2086 2088 if (hBCrypt) 2087 2089 {
Note:
See TracChangeset
for help on using the changeset viewer.