VirtualBox

Ignore:
Timestamp:
Oct 16, 2020 2:34:15 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140983
Message:

SUPHArdNt,IPRT: Recognize WHQL/attestation signatures from MS. Corrected RTCRX509TBSCERTIFICATE::T3::fExtKeyUsage type (32 -> 64 bit) as it has been to small for a while now. bugref:3103

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupVerify.cpp

    r82968 r86610  
    4040
    4141
     42//#define DYNAMIC
     43#ifdef DYNAMIC
     44# include <iprt/win/windows.h>
     45
     46# define DYNAMIC_IMPORTS() \
     47    ONE_IMPORT(RTR3InitExe); \
     48    ONE_IMPORT(RTMsgInitFailure); \
     49    ONE_IMPORT(RTGetOpt); \
     50    ONE_IMPORT(RTGetOptInit); \
     51    ONE_IMPORT(RTGetOptPrintError); \
     52    ONE_IMPORT(RTMsgError); \
     53    ONE_IMPORT(RTMsgErrorExit); \
     54    ONE_IMPORT(RTMsgInfo); \
     55    ONE_IMPORT(RTPrintf); \
     56    ONE_IMPORT(SUPR3HardenedVerifyInit); \
     57    ONE_IMPORT(SUPR3HardenedVerifyPlugIn)
     58
     59# define ONE_IMPORT(a_fnName) static decltype(a_fnName) *g_pfn##a_fnName
     60DYNAMIC_IMPORTS();
     61# undef ONE_IMPORT
     62
     63static void resolve(void)
     64{
     65    HMODULE hmod = LoadLibrary("VBoxRT.dll");
     66    DWORD cbWritten = 0;
     67
     68# define ONE_IMPORT(a_fnName) do { \
     69            g_pfn##a_fnName = (decltype(a_fnName) *)GetProcAddress(hmod, #a_fnName); \
     70            if (!g_pfn##a_fnName) \
     71                WriteFile(GetStdHandle(STD_ERROR_HANDLE), RT_STR_TUPLE("Failed to resolve: " #a_fnName "\r\n"), &cbWritten, NULL); \
     72        } while (0)
     73    DYNAMIC_IMPORTS();
     74# undef ONE_IMPORT
     75}
     76
     77#define RTR3InitExe                  g_pfnRTR3InitExe
     78#define RTMsgInitFailure             g_pfnRTMsgInitFailure
     79#define RTGetOpt                     g_pfnRTGetOpt
     80#define RTGetOptInit                 g_pfnRTGetOptInit
     81#define RTGetOptPrintError           g_pfnRTGetOptPrintError
     82#define RTMsgError                   g_pfnRTMsgError
     83#define RTMsgErrorExit               g_pfnRTMsgErrorExit
     84#define RTMsgInfo                    g_pfnRTMsgInfo
     85#define RTPrintf                     g_pfnRTPrintf
     86#define SUPR3HardenedVerifyInit      g_pfnSUPR3HardenedVerifyInit
     87#define SUPR3HardenedVerifyPlugIn    g_pfnSUPR3HardenedVerifyPlugIn
     88
     89#endif /* DYNAMIC */
     90
    4291int main(int argc, char **argv)
    4392{
     
    4594     * Init.
    4695     */
     96#ifdef DYNAMIC
     97    resolve();
     98#endif
    4799    int rc = RTR3InitExe(argc, &argv, 0);
    48100    if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

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