VirtualBox

Ignore:
Timestamp:
Mar 31, 2015 7:20:36 AM (10 years ago)
Author:
vboxsync
Message:

supHardNt: bcrypt.dll is not mandatory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp

    r55007 r55017  
    19091909 * Loads a module in the system32 directory.
    19101910 *
    1911  * @returns Module handle on success. Won't return on faliure.
     1911 * @returns Module handle on success. Won't return on failure if fMandatory = true.
    19121912 * @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 */
     1915DECLHIDDEN(HMODULE) supR3HardenedWinLoadSystem32Dll(const char *pszName, bool fMandatory)
    19151916{
    19161917    WCHAR wszName[200+60];
     
    19311932        hMod = LoadLibraryExW(wszName, NULL, fFlags);
    19321933    }
    1933     if (hMod == NULL)
     1934    if (   hMod == NULL
     1935        && fMandatory)
    19341936        supR3HardenedFatal("Error loading '%s': %u [%ls]", pszName, RtlGetLastWin32Error(), wszName);
    19351937    return hMod;
     
    19501952     * Load crypt32.dll and resolve the APIs we need.
    19511953     */
    1952     HMODULE hCrypt32 = supR3HardenedWinLoadSystem32Dll("crypt32.dll");
     1954    HMODULE hCrypt32 = supR3HardenedWinLoadSystem32Dll("crypt32.dll", true /*fMandatory*/);
    19531955
    19541956#define RESOLVE_CRYPT32_API(a_Name, a_pfnType) \
     
    20562058     * Resolve the imports we need.
    20572059     */
    2058     HMODULE hWintrust = supR3HardenedWinLoadSystem32Dll("Wintrust.dll");
     2060    HMODULE hWintrust = supR3HardenedWinLoadSystem32Dll("Wintrust.dll", true /*fMandatory*/);
    20592061#define RESOLVE_CRYPT_API(a_Name, a_pfnType, a_uMinWinVer) \
    20602062    do { \
     
    20832085     * make sure the providers are cached for later us.  Avoid recursion issues.
    20842086     */
    2085     HMODULE hBCrypt = supR3HardenedWinLoadSystem32Dll("bcrypt.dll");
     2087    HMODULE hBCrypt = supR3HardenedWinLoadSystem32Dll("bcrypt.dll", false /*fMandatory*/);
    20862088    if (hBCrypt)
    20872089    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette