VirtualBox

Changeset 59385 in vbox for trunk/src/VBox/Main/src-all/win


Ignore:
Timestamp:
Jan 18, 2016 5:37:59 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105078
Message:

VBoxProxyStub,comregister,glue: Added a second proxy dll for older 64-bit windows versions since we're having trouble convincing MIDL to produce code that works with XP64/W2K3 without indicating that we're targetting windows 2000 and dropping the ndr64/all protocol option. Using the legacy proxy stub for vista and windows server 2008 too, since there was some potentially interesting changes introduced with windows 7 that we might benefit from.

Location:
trunk/src/VBox/Main/src-all/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r59370 r59385  
    6969# define VBSP_LOG_DEL_KEY(a)        do { } while (0)
    7070#endif
     71
     72/**
     73 * Selects the proxy stub DLL based on 32-on-64-bit and host OS version.
     74 *
     75 * The legacy DLL covers 64-bit pre Windows 7 versions of Windows. W2K3-amd64
     76 * has trouble parsing the result when MIDL /target NT51 or higher. Vista and
     77 * windows server 2008 seems to have trouble with newer IDL compilers.
     78 */
     79#define VBPS_PROXY_STUB_FILE(a_fIs32On64) \
     80    ( (a_fIs32On64) ? "x86\\VBoxProxyStub-x86.dll" \
     81      : RT_MAKE_U64(((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMinorVersion, \
     82                    ((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMajorVersion) >= RT_MAKE_U64(1/*Lo*/,6/*Hi*/) \
     83        ? "VBoxProxyStub.dll" : "VBoxProxyStubLegacy.dll" )
    7184
    7285
     
    142155            /* Init IPRT. */
    143156            RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
     157
     158#ifdef VBOX_STRICT
     159            {
     160                /*
     161                 * Check that no interface has more than 256 methods in the stub vtable.
     162                 */
     163                const ProxyFileInfo **ppProxyFile = &g_apProxyFiles[0];
     164                const ProxyFileInfo  *pProxyFile;
     165                while ((pProxyFile = *ppProxyFile++) != NULL)
     166                {
     167                    const PCInterfaceStubVtblList * const   papStubVtbls  = pProxyFile->pStubVtblList;
     168                    const char * const                     *papszNames    = pProxyFile->pNamesArray;
     169                    unsigned                                iIf           = pProxyFile->TableSize;
     170                    AssertStmt(iIf < 1024, iIf = 0);
     171                    Assert(pProxyFile->TableVersion == 2);
     172
     173                    while (iIf-- > 0)
     174                        AssertMsg(papStubVtbls[iIf]->header.DispatchTableCount <= 256,
     175                                  ("%s: DispatchTableCount=%d\n", papszNames[iIf], papStubVtbls[iIf]->header.DispatchTableCount));
     176                }
     177            }
     178#endif
    144179            break;
    145180
     
    11071142        unsigned i = pState->cAltDeletes;
    11081143        while (i-- > 0)
    1109             vbpsDeleteKeyRecursiveA(pState, pState->aAltDeletes[i].hkeyClsid, szClsId, __LINE__);
     1144            if (pState->aAltDeletes[i].hkeyClsid != NULL)
     1145                vbpsDeleteKeyRecursiveA(pState, pState->aAltDeletes[i].hkeyClsid, szClsId, __LINE__);
    11101146        vbpsDeleteKeyRecursiveA(pState, pState->hkeyClsidRootDst, szClsId, __LINE__);
    11111147    }
     
    12321268static void vbpsUpdateTypeLibRegistration(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir, bool fIs32On64)
    12331269{
    1234     const char * const pszTypeLibDll = !fIs32On64 ? "VBoxProxyStub.dll" : "x86\\VBoxProxyStub-x86.dll";
     1270    const char * const pszTypeLibDll = VBPS_PROXY_STUB_FILE(fIs32On64);
    12351271    const char * const pszWinXx      = !fIs32On64 ? "win64"             : "win32";
    12361272    const char * const pszDescription = "VirtualBox Type Library";
     
    13161352     * It's simple compared to the VBox classes, thus all the NULL parameters.
    13171353     */
    1318     const char *pszPsDll = !fIs32On64 ? "VBoxProxyStub.dll" : "x86\\VBoxProxyStub-x86.dll";
     1354    const char *pszPsDll = VBPS_PROXY_STUB_FILE(fIs32On64);
    13191355    Assert(pState->fUpdate && !pState->fDelete);
    13201356    VbpsRegisterClassId(pState, &g_ProxyClsId, "PSFactoryBuffer", NULL /*pszAppId*/,
  • trunk/src/VBox/Main/src-all/win/comregister.cmd

    r59365 r59385  
    77
    88REM
    9 REM Copyright (C) 2006-2015 Oracle Corporation
     9REM Copyright (C) 2006-2016 Oracle Corporation
    1010REM
    1111REM This file is part of VirtualBox Open Source Edition (OSE), as
     
    121121REM
    122122set fNoProxy=0
    123 if "%WinVerMajor%" == "5" set fNoProxy=1
    124 if "%WinVerMajor%" == "4" set fNoProxy=1
    125123set fUninstallOnly=0
    126124
     
    173171REM Unregister all first, then register them. The order matters here.
    174172:register_amd64
     173if "%WinVerMajor%" == "5" goto register_amd64_legacy
     174if not "%WinVerMajor%" == "6" goto register_amd64_not_legacy
     175if not "%WinVerMinor%" == "0" goto register_amd64_not_legacy
     176:register_amd64_legacy
     177set s64BitProxyStub=VBoxProxyStubLegacy.dll
     178goto register_amd64_begin
     179:register_amd64_not_legacy
     180set s64BitProxyStub=VBoxProxyStub.dll
     181:register_amd64_begin
     182echo s64BitProxyStub=%s64BitProxyStub%
    175183@echo on
    176184"%_VBOX_DIR%VBoxSVC.exe" /UnregServer
    177185%windir%\system32\regsvr32 /s /u "%_VBOX_DIR%VBoxC.dll"
    178186%windir%\syswow64\regsvr32 /s /u "%_VBOX_DIR%x86\VBoxClient-x86.dll"
    179 %windir%\system32\regsvr32 /s /u "%_VBOX_DIR%VBoxProxyStub.dll"
     187%windir%\system32\regsvr32 /s /u "%_VBOX_DIR%%s64BitProxyStub%"
    180188%windir%\syswow64\regsvr32 /s /u "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll"
    181189if %fUninstallOnly% == 1 goto end
     
    184192%windir%\syswow64\regsvr32 /s    "%_VBOX_DIR%x86\VBoxClient-x86.dll"
    185193if %fNoProxy% == 1 goto end
    186 if exist "%_VBOX_DIR%VBoxProxyStub.dll"         %windir%\system32\regsvr32 /s "%_VBOX_DIR%VBoxProxyStub.dll"
     194if exist "%_VBOX_DIR%%s64BitProxyStub%"         %windir%\system32\regsvr32 /s "%_VBOX_DIR%%s64BitProxyStub%"
    187195if exist "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll" %windir%\syswow64\regsvr32 /s "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll"
    188196@echo off
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