Changeset 59385 in vbox
- Timestamp:
- Jan 18, 2016 5:37:59 PM (9 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r59371 r59385 929 929 VBoxCOM_SOURCES += \ 930 930 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c 931 VBoxCOM_CLEAN = \ 932 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \ 933 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \ 934 $(VBoxCOM_0_OUTDIR)/dlldata.c \ 935 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \ 936 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb 937 ifeq ($(KBUILD_TARGET_ARCH),amd64) 938 VBoxCOM_CLEAN += \ 939 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_i.c \ 940 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_p.c \ 941 $(VBoxCOM_0_OUTDIR)/old64/dlldata.c \ 942 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox.h \ 943 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox.tlb 944 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/old64/ 945 endif 931 946 else # !win 932 947 VBoxCOM_SOURCES += \ … … 944 959 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86 945 960 VBoxCOM-x86_EXTENDS = VBoxCOM 961 ifeq ($(KBUILD_TARGET),win) 962 VBoxCOM-x86_CLEAN = \ 963 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \ 964 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \ 965 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \ 966 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \ 967 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.tlb 968 endif 946 969 endif 947 970 … … 1012 1035 if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win" 1013 1036 # 1014 # Experimental COM proxy + stub DLL. 1037 # Experimental COM proxy + stub DLL w/ automatic registration updating. 1038 # 1039 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we 1040 # were having various problems on windows server 2003 and 2008 with the code 1041 # MIDL generated. Also, in windows 7 there are some potentially interesting 1042 # changes in the generated code where it uses new helpers from OLE32. 1015 1043 # 1016 1044 DLLS += VBoxProxyStub … … 1030 1058 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb 1031 1059 1060 DLLS += VBoxProxyStubLegacy 1061 VBoxProxyStubLegacy_TEMPLATE = VBOXMAINCOMP 1062 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub 1063 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY 1064 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/old64/ 1065 VBoxProxyStubLegacy_SOURCES = \ 1066 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_p.c \ 1067 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_i.c \ 1068 src-all/win/VBoxProxyStub.def \ 1069 src-all/win/VBoxProxyStub.rc \ 1070 src-all/win/VBoxProxyStub.c 1071 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/old64/VirtualBox.tlb 1072 1032 1073 ifdef VBOX_WITH_32_ON_64_MAIN_API 1033 1074 DLLS += VBoxProxyStub-x86 … … 1092 1133 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE) 1093 1134 1135 # Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64. 1136 # The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32). 1094 1137 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \ 1095 1138 + $(VBoxCOM_0_OUTDIR)/VirtualBox.h \ … … 1097 1140 + $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@) 1098 1141 $(VBOX_WIN_MIDL) /nologo \ 1099 $(if-expr "$(KBUILD_TARGET_ARCH)" == "amd64" && "$(KBUILD_HOST)" == "win",/env amd64,/env win32) \ 1100 /robust /protocol all /target NT51 \ 1142 $(if-expr "$(KBUILD_TARGET_ARCH)" == "amd64" && "$(KBUILD_HOST)" == "win" \ 1143 ,/env amd64 /robust /protocol all /target NT61\ 1144 ,/env win32 /robust /protocol all /target NT51) \ 1101 1145 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \ 1102 1146 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \ … … 1104 1148 /I idl \ 1105 1149 $(call VBOX_FN_MAKE_WIN_PATH,$<) 1150 1151 if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET_ARCH)" == "amd64" 1152 # -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'. 1153 # -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed 1154 # that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works. 1155 $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_i.c \ 1156 + $(VBoxCOM_0_OUTDIR)/old64/VirtualBox_p.c\ 1157 + $(VBoxCOM_0_OUTDIR)/old64/dlldata.c \ 1158 + $(VBoxCOM_0_OUTDIR)/old64/VirtualBox.h \ 1159 + $(VBoxCOM_0_OUTDIR)/old64/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@) 1160 $(VBOX_WIN_MIDL) /nologo \ 1161 /env win64 /x64 /robust /target NT50 \ 1162 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \ 1163 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \ 1164 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \ 1165 /I idl \ 1166 $(call VBOX_FN_MAKE_WIN_PATH,$<) 1167 endif 1106 1168 1107 1169 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \ -
trunk/src/VBox/Main/glue/initterm.cpp
r59368 r59385 19 19 #if !defined(VBOX_WITH_XPCOM) 20 20 21 # include <iprt/nt/nt-and-windows.h> 21 22 # include <objbase.h> 22 23 … … 254 255 int vrc = RTPathAppPrivateArch(szPath, sizeof(szPath)); 255 256 if (RT_SUCCESS(vrc)) 257 { 256 258 # ifndef VBOX_IN_32_ON_64_MAIN_API 257 rc = RTPathAppend(szPath, sizeof(szPath), "VBoxProxyStub.dll"); 259 rc = RTPathAppend(szPath, sizeof(szPath), 260 # if ARCH_BITS == 64 261 RT_MAKE_U64(((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMinorVersion, 262 ((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMajorVersion) 263 >= RT_MAKE_U64(1/*Lo*/,6/*Hi*/) 264 ? "VBoxProxyStub.dll" : "VBoxProxyStubLegacy.dll" 265 # else 266 "VBoxProxyStub.dll" 267 # endif 268 ); 258 269 # else 259 270 rc = RTPathAppend(szPath, sizeof(szPath), "x86\\VBoxProxyStub-x86.dll"); 260 271 # endif 272 } 261 273 if (RT_SUCCESS(vrc)) 262 274 { -
trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
r59370 r59385 69 69 # define VBSP_LOG_DEL_KEY(a) do { } while (0) 70 70 #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" ) 71 84 72 85 … … 142 155 /* Init IPRT. */ 143 156 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 144 179 break; 145 180 … … 1107 1142 unsigned i = pState->cAltDeletes; 1108 1143 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__); 1110 1146 vbpsDeleteKeyRecursiveA(pState, pState->hkeyClsidRootDst, szClsId, __LINE__); 1111 1147 } … … 1232 1268 static void vbpsUpdateTypeLibRegistration(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir, bool fIs32On64) 1233 1269 { 1234 const char * const pszTypeLibDll = !fIs32On64 ? "VBoxProxyStub.dll" : "x86\\VBoxProxyStub-x86.dll";1270 const char * const pszTypeLibDll = VBPS_PROXY_STUB_FILE(fIs32On64); 1235 1271 const char * const pszWinXx = !fIs32On64 ? "win64" : "win32"; 1236 1272 const char * const pszDescription = "VirtualBox Type Library"; … … 1316 1352 * It's simple compared to the VBox classes, thus all the NULL parameters. 1317 1353 */ 1318 const char *pszPsDll = !fIs32On64 ? "VBoxProxyStub.dll" : "x86\\VBoxProxyStub-x86.dll";1354 const char *pszPsDll = VBPS_PROXY_STUB_FILE(fIs32On64); 1319 1355 Assert(pState->fUpdate && !pState->fDelete); 1320 1356 VbpsRegisterClassId(pState, &g_ProxyClsId, "PSFactoryBuffer", NULL /*pszAppId*/, -
trunk/src/VBox/Main/src-all/win/comregister.cmd
r59365 r59385 7 7 8 8 REM 9 REM Copyright (C) 2006-201 5Oracle Corporation9 REM Copyright (C) 2006-2016 Oracle Corporation 10 10 REM 11 11 REM This file is part of VirtualBox Open Source Edition (OSE), as … … 121 121 REM 122 122 set fNoProxy=0 123 if "%WinVerMajor%" == "5" set fNoProxy=1124 if "%WinVerMajor%" == "4" set fNoProxy=1125 123 set fUninstallOnly=0 126 124 … … 173 171 REM Unregister all first, then register them. The order matters here. 174 172 :register_amd64 173 if "%WinVerMajor%" == "5" goto register_amd64_legacy 174 if not "%WinVerMajor%" == "6" goto register_amd64_not_legacy 175 if not "%WinVerMinor%" == "0" goto register_amd64_not_legacy 176 :register_amd64_legacy 177 set s64BitProxyStub=VBoxProxyStubLegacy.dll 178 goto register_amd64_begin 179 :register_amd64_not_legacy 180 set s64BitProxyStub=VBoxProxyStub.dll 181 :register_amd64_begin 182 echo s64BitProxyStub=%s64BitProxyStub% 175 183 @echo on 176 184 "%_VBOX_DIR%VBoxSVC.exe" /UnregServer 177 185 %windir%\system32\regsvr32 /s /u "%_VBOX_DIR%VBoxC.dll" 178 186 %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%" 180 188 %windir%\syswow64\regsvr32 /s /u "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll" 181 189 if %fUninstallOnly% == 1 goto end … … 184 192 %windir%\syswow64\regsvr32 /s "%_VBOX_DIR%x86\VBoxClient-x86.dll" 185 193 if %fNoProxy% == 1 goto end 186 if exist "%_VBOX_DIR% VBoxProxyStub.dll" %windir%\system32\regsvr32 /s "%_VBOX_DIR%VBoxProxyStub.dll"194 if exist "%_VBOX_DIR%%s64BitProxyStub%" %windir%\system32\regsvr32 /s "%_VBOX_DIR%%s64BitProxyStub%" 187 195 if exist "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll" %windir%\syswow64\regsvr32 /s "%_VBOX_DIR%x86\VBoxProxyStub-x86.dll" 188 196 @echo off
Note:
See TracChangeset
for help on using the changeset viewer.