VirtualBox

Ignore:
Timestamp:
Jul 11, 2014 2:57:40 AM (10 years ago)
Author:
vboxsync
Message:

Need to initialize the SUPR3HardenedVerify* bits in the extension pack manager too, so split it (the init code) out into a separate API.

File:
1 edited

Legend:

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

    r51970 r51978  
    8080#endif
    8181
     82/*******************************************************************************
     83*   Global Variables                                                           *
     84*******************************************************************************/
     85static bool g_fHardenedVerifyInited = false;
     86
     87
     88int suplibOsHardenedVerifyInit(void)
     89{
     90    if (!g_fHardenedVerifyInited)
     91    {
     92#if defined(VBOX_WITH_HARDENING) && !defined(IN_SUP_HARDENED_R3) && !defined(IN_SUP_R3_STATIC)
     93        supR3HardenedWinInitVersion();
     94        int rc = supHardenedWinInitImageVerifier(NULL);
     95        if (RT_FAILURE(rc))
     96            return rc;
     97        supR3HardenedWinResolveVerifyTrustApiAndHookThreadCreation();
     98#endif
     99        g_fHardenedVerifyInited = true;
     100    }
     101    return VINF_SUCCESS;
     102}
     103
     104
     105int suplibOsHardenedVerifyTerm(void)
     106{
     107    /** @todo free resources...  */
     108    return VINF_SUCCESS;
     109}
     110
    82111
    83112int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted)
     
    86115     * Make sure the image verifier is fully initialized.
    87116     */
    88 #if defined(VBOX_WITH_HARDENING) && !defined(IN_SUP_HARDENED_R3) && !defined(IN_SUP_R3_STATIC)
    89     supR3HardenedWinInitVersion();
    90     int rc = supHardenedWinInitImageVerifier(NULL);
     117    int rc = suplibOsHardenedVerifyInit();
    91118    if (RT_FAILURE(rc))
    92119        return rc;
    93     supR3HardenedWinResolveVerifyTrustApiAndHookThreadCreation();
    94 #endif
    95120
    96121    /*
     
    199224}
    200225
     226
    201227#ifndef IN_SUP_HARDENED_R3
    202228
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