Changeset 66279 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 28, 2017 7:23:33 AM (8 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r66274 r66279 75 75 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \ 76 76 $(if $(VBOX_WITH_MIDL_PROXY_STUB),VBOX_WITH_MIDL_PROXY_STUB,) \ 77 77 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) \ 78 78 79 79 # Unconditionally enable the new semaphore key generation code … … 127 127 $(VBOX_PATH_SDK)/bindings/xpcom/idl \ 128 128 $(VBOX_PATH_SDK)/bindings/xpcom/include 129 # switch off VBoxSDS inXPCOM130 override VBOX_WITH_SDS = 129 # disable VBoxSDS for XPCOM 130 override VBOX_WITH_SDS = 131 131 endif # xpcom 132 132 … … 735 735 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \ 736 736 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \ 737 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 737 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 738 738 ifdef VBOX_WITH_CRHGSMI 739 739 VBoxC_DEFS += VBOX_WITH_CRHGSMI … … 1147 1147 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP 1148 1148 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \ 1149 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 1149 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) 1150 1150 VBoxProxyStub_DEFS.win.x86 = WIN32 1151 1151 VBoxProxyStub_SDKS = VBOX_NTDLL … … 1221 1221 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@) 1222 1222 $(QUIET)$(VBOX_XSLTPROC) -o $@ \ 1223 1224 1225 1223 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \ 1224 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \ 1225 $< $(VBOX_XIDL_FILE) 1226 1226 1227 1227 # Aliases for testing purposes. -
trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h
r66274 r66279 79 79 /** 80 80 * Prints current user name of this thread to the log 81 * @prefix - strigng fragment that will be inserted at beginning of logging line 81 * @param prefix string fragment that will be inserted at the beginning 82 * of the logging line 82 83 */ 83 84 void LogUserName(char *prefix); 84 85 85 /** 86 /** 86 87 * Thread that periodically checks items in cache and cleans obsolete items 87 88 */ -
trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
r66274 r66279 1016 1016 * @returns Windows error code (errors are rememberd in the state). 1017 1017 * @param pState The registry modifier state. 1018 * @param pszModuleName The module name. 1018 1019 * @param pszAppId The application UUID string. 1019 1020 * @param pszDescription The description string. 1020 * @param bIsService The application is windows service 1021 */ 1022 LSTATUS VbpsRegisterAppId( 1023 VBPSREGSTATE *pState, 1024 const char *pszModuleName, 1025 const char *pszAppId, 1026 const char *pszDescription, 1027 bool bIsService) 1021 * @param fIsService The application is windows service 1022 */ 1023 LSTATUS VbpsRegisterAppId(VBPSREGSTATE *pState, const char *pszModuleName, const char *pszAppId, 1024 const char *pszDescription, bool fIsService) 1028 1025 { 1029 1026 LSTATUS rc; … … 1052 1049 rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/, 1053 1050 pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/); 1054 1055 1051 else 1056 1052 { … … 1067 1063 } 1068 1064 1069 if (pState->fUpdate) 1065 if (pState->fUpdate) 1066 { 1067 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__); 1068 1069 if (fIsService) 1070 1070 { 1071 //HKEY hkeyApp; 1072 HKEY hkeyServiceExe; 1073 1074 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__); 1075 1076 if (bIsService) 1077 { 1078 HKEY hkeyApp; 1079 1080 char szModule[MAX_PATH + 2]; 1081 size_t len = RTStrNLen(pszModuleName, MAX_PATH); 1082 Assert(len); 1083 Assert(len < MAX_PATH); 1084 rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName); 1085 AssertRC(rc); 1086 szModule[len - 4] = '\0'; 1087 1088 rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp); 1089 if (rc == ERROR_FILE_NOT_FOUND) 1090 return ERROR_SUCCESS; 1091 // create the value "Service" with the service name 1092 vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__); 1093 vbpsCloseKey(pState, hkeyApp, __LINE__); 1094 } 1095 1096 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__); 1097 rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe); 1071 char szModule[MAX_PATH + 2]; 1072 size_t len = RTStrNLen(pszModuleName, MAX_PATH); 1073 Assert(len); 1074 Assert(len < MAX_PATH); 1075 rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName); 1076 AssertRC(rc); 1077 szModule[len - 4] = '\0'; 1078 1079 HKEY hkeyApp; 1080 rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp); 1098 1081 if (rc == ERROR_FILE_NOT_FOUND) 1099 1082 return ERROR_SUCCESS; 1100 vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__); 1101 vbpsCloseKey(pState, hkeyServiceExe, __LINE__); 1083 // create the value "Service" with the service name 1084 vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__); 1085 vbpsCloseKey(pState, hkeyApp, __LINE__); 1102 1086 } 1087 1088 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__); 1089 1090 HKEY hkeyServiceExe; 1091 rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe); 1092 if (rc == ERROR_FILE_NOT_FOUND) 1093 return ERROR_SUCCESS; 1094 vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__); 1095 vbpsCloseKey(pState, hkeyServiceExe, __LINE__); 1096 } 1103 1097 1104 1098 vbpsCloseKey(pState, hkeyAppIds, __LINE__); … … 1288 1282 1289 1283 /* AppID = pszAppId */ 1290 if (pszAppId && fQuoteIt)1284 if (pszAppId && fQuoteIt) 1291 1285 vbpsSetRegValueAA(pState, hkeyClass, "AppID", pszAppId, __LINE__); 1292 1286 … … 1339 1333 const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll"; 1340 1334 const char *pszLocalServer = "VBoxSVC.exe"; 1341 1335 1342 1336 VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", false); 1343 1337 -
trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp
r66274 r66279 70 70 71 71 HRESULT rc = CoCreateInstance(CLSID_VirtualBoxSDS, /* the VirtualBoxSDS object */ 72 NULL,/* no aggregation */73 CLSCTX_LOCAL_SERVER,/* the object lives in the current process */74 IID_IVirtualBoxSDS, /* IID of the interface */75 (void **)aVirtualBoxSDS.asOutParam());72 NULL, /* no aggregation */ 73 CLSCTX_LOCAL_SERVER, /* the object lives in the current process */ 74 IID_IVirtualBoxSDS, /* IID of the interface */ 75 (void **)aVirtualBoxSDS.asOutParam()); 76 76 if (FAILED(rc)) 77 77 { … … 97 97 98 98 HRESULT rc = CoCreateInstance(CLSID_VirtualBoxSDS, /* the VirtualBoxSDS object */ 99 NULL,/* no aggregation */100 CLSCTX_LOCAL_SERVER,/* the object lives in the current process */101 IID_IVirtualBoxSDS, /* IID of the interface */102 (void **)aVirtualBoxSDS.asOutParam());99 NULL, /* no aggregation */ 100 CLSCTX_LOCAL_SERVER, /* the object lives in the current process */ 101 IID_IVirtualBoxSDS, /* IID of the interface */ 102 (void **)aVirtualBoxSDS.asOutParam()); 103 103 if (FAILED(rc)) 104 104 { … … 132 132 // TODO: AM rework for final version 133 133 // setup COM Security to enable impersonation 134 // This works for console Virtual Box clients, GUI has own security settings 134 // This works for console Virtual Box clients, GUI has own security settings 135 135 // For GUI Virtual Box it will be second call so can return TOO_LATE error 136 136 HRESULT hrGUICoInitializeSecurity = CoInitializeSecurity(NULL, 137 -1,138 NULL,139 NULL,140 RPC_C_AUTHN_LEVEL_DEFAULT,141 RPC_C_IMP_LEVEL_IMPERSONATE, //RPC_C_IMP_LEVEL_DELEGATE,//RPC_C_IMP_LEVEL_IMPERSONATE,142 NULL,143 EOAC_NONE,//EOAC_NONE,//EOAC_DYNAMIC_CLOAKING,//EOAC_STATIC_CLOAKING,144 NULL);137 -1, 138 NULL, 139 NULL, 140 RPC_C_AUTHN_LEVEL_DEFAULT, 141 RPC_C_IMP_LEVEL_IMPERSONATE, 142 NULL, 143 EOAC_NONE, 144 NULL); 145 145 //Assert(RPC_E_TOO_LATE != hrGUICoInitializeSecurity); 146 146 Assert(SUCCEEDED(hrGUICoInitializeSecurity) || hrGUICoInitializeSecurity == RPC_E_TOO_LATE); … … 170 170 mData.m_ThreadWatcher = NIL_RTTHREAD; 171 171 mData.m_SemEvWatcher = NIL_RTSEMEVENT; 172 172 173 173 #ifdef VBOX_WITH_SDS 174 // TODO: AM create virtual box through SDS 174 // TODO: AM create virtual box through SDS 175 175 rc = CreateVirtualBoxThroughSDS(mData.m_pVirtualBox); 176 176 #else
Note:
See TracChangeset
for help on using the changeset viewer.