Changeset 66358 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 30, 2017 11:05:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
r66353 r66358 1019 1019 * @param pszAppId The application UUID string. 1020 1020 * @param pszDescription The description string. 1021 * @param fIsService The application is windows service 1021 * @param pszServiceName The window service name if the application is a 1022 * service, otherwise this must be NULL. 1022 1023 */ 1023 1024 LSTATUS VbpsRegisterAppId(VBPSREGSTATE *pState, const char *pszModuleName, const char *pszAppId, 1024 const char *pszDescription, bool fIsService)1025 const char *pszDescription, const char *pszServiceName) 1025 1026 { 1026 1027 LSTATUS rc; … … 1063 1064 } 1064 1065 1066 /* 1067 * Register / update. 1068 */ 1065 1069 if (pState->fUpdate) 1066 1070 { 1067 HKEY hkeyServiceExe; 1068 1069 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__); 1070 1071 if (fIsService) 1071 HKEY hkey; 1072 rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszAppId, &hkey, __LINE__); 1073 if (rc == ERROR_SUCCESS) 1072 1074 { 1073 char szModule[MAX_PATH + 2]; 1074 HKEY hkeyApp; 1075 size_t len = RTStrNLen(pszModuleName, MAX_PATH); 1076 Assert(len); 1077 Assert(len < MAX_PATH); 1078 rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName); 1079 AssertRC(rc); 1080 szModule[len - 4] = '\0'; 1081 1082 rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp); 1083 if (rc == ERROR_FILE_NOT_FOUND) 1084 return ERROR_SUCCESS; 1085 // create the value "Service" with the service name 1086 vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__); 1087 vbpsCloseKey(pState, hkeyApp, __LINE__); 1075 vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, pszDescription, __LINE__); 1076 if (pszServiceName) 1077 vbpsSetRegValueAA(pState, hkey, "LocalService", pszServiceName, __LINE__); 1078 vbpsCloseKey(pState, hkey, __LINE__); 1088 1079 } 1089 1080 1090 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__);1091 1092 rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe);1093 if (rc == ERROR_FILE_NOT_FOUND)1094 return ERROR_SUCCESS;1095 vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__);1096 vbpsCloseKey(pState, hkeyServiceExe, __LINE__);1081 rc = vbpsCreateRegKeyA(pState, hkeyAppIds, pszModuleName, &hkey, __LINE__); 1082 if (rc == ERROR_SUCCESS) 1083 { 1084 vbpsSetRegValueAA(pState, hkey, NULL /*pszValueNm*/, "", __LINE__); 1085 vbpsSetRegValueAA(pState, hkey, "AppID", pszAppId, __LINE__); 1086 vbpsCloseKey(pState, hkey, __LINE__); 1087 } 1097 1088 } 1098 1089 … … 1293 1284 1294 1285 1295 #ifdef VBOX_WITH_SDS1296 /**1297 * Register VBoxSDS classes from the VirtualBox.xidl file.1298 *1299 * @returns COM status code.1300 * @param pState1301 * @param pwszVBoxDir The VirtualBox application directory.1302 *1303 * @todo convert to XSLT.1304 */1305 void RegisterVBoxSDSXidl(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir)1306 {1307 const char *pszServiceAppId = "{EC0E78E8-FA43-43E8-AC0A-02C784C4A4FA}";1308 const char *pszWindowsService = "VBoxSDS.exe";1309 1310 /* VBoxSDS */1311 VbpsRegisterAppId(pState, pszWindowsService, pszServiceAppId, "VirtualBox System Service", true);1312 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS.1", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, NULL);1313 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, ".1");1314 VbpsRegisterClassId(pState, &CLSID_VirtualBoxSDS, "VirtualBoxSDS Class", pszServiceAppId, "VirtualBox.VirtualBoxSDS", ".1",1315 &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszWindowsService, NULL /*N/A*/);1316 }1317 #endif /* VBOX_WITH_SDS */1318 1319 1320 1286 /** 1321 1287 * Register modules and classes from the VirtualBox.xidl file. … … 1330 1296 void RegisterXidlModulesAndClassesGenerated(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir, bool fIs32On64) 1331 1297 { 1332 const char *pszAppId = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}"; 1333 const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll"; 1334 const char *pszLocalServer = "VBoxSVC.exe"; 1298 const char *pszAppId = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}"; 1299 const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll"; 1300 const char *pszLocalServer = "VBoxSVC.exe"; 1301 #ifdef VBOX_WITH_SDS 1302 const char *pszSdsAppId = "{EC0E78E8-FA43-43E8-AC0A-02C784C4A4FA}"; 1303 const char *pszSdsExe = "VBoxSDS.exe"; 1304 const char *pszSdsServiceName = "VBoxSDS"; 1305 #endif 1335 1306 1336 1307 /* VBoxSVC */ 1337 VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", false);1308 VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", NULL); 1338 1309 VbpsRegisterClassName(pState, "VirtualBox.VirtualBox.1", "VirtualBox Class", &CLSID_VirtualBox, NULL); 1339 1310 VbpsRegisterClassName(pState, "VirtualBox.VirtualBox", "VirtualBox Class", &CLSID_VirtualBox, ".1"); … … 1353 1324 1354 1325 #ifdef VBOX_WITH_SDS 1355 RegisterVBoxSDSXidl(pState, pwszVBoxDir); 1326 /* VBoxSDS */ 1327 VbpsRegisterAppId(pState, pszSdsExe, pszSdsAppId, "VirtualBox System Service", pszSdsServiceName); 1328 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS.1", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, NULL); 1329 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, ".1"); 1330 VbpsRegisterClassId(pState, &CLSID_VirtualBoxSDS, "VirtualBoxSDS Class", pszSdsAppId, "VirtualBox.VirtualBoxSDS", ".1", 1331 &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszSdsExe, NULL /*N/A*/); 1356 1332 #endif 1357 1333 }
Note:
See TracChangeset
for help on using the changeset viewer.