Changeset 89746 in vbox
- Timestamp:
- Jun 16, 2021 2:39:18 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
r89571 r89746 637 637 com::Bstr bstrUserFullName(sUserFullName); 638 638 com::Bstr bstrPwd(strPwd); 639 com::Bstr bstrDependencies("Winmgmt\0RpcSs\0\0"); 639 640 640 641 SC_HANDLE hSvc = CreateServiceW(hSCM, /* hSCManager */ … … 648 649 NULL, /* lpLoadOrderGroup */ 649 650 NULL, /* lpdwTagId */ 650 NULL,/* lpDependencies */651 bstrDependencies.raw(), /* lpDependencies */ 651 652 bstrUserFullName.raw(), /* lpServiceStartName (NULL => LocalSystem) */ 652 653 bstrPwd.raw()); /* lpPassword */ … … 997 998 998 999 /* 1000 * Init com here for first main thread initialization. 1001 * Service main function called in another thread 1002 * created by service manager. 1003 */ 1004 HRESULT hrc = com::Initialize(); 1005 # ifdef VBOX_WITH_XPCOM 1006 if (hrc == NS_ERROR_FILE_ACCESS_DENIED) 1007 { 1008 char szHome[RTPATH_MAX] = ""; 1009 com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome)); 1010 return RTMsgErrorExit(RTEXITCODE_FAILURE, 1011 "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome); 1012 } 1013 # endif 1014 if (FAILED(hrc)) 1015 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM (%Rhrc)!", hrc); 1016 1017 /* 999 1018 * Initialize release logging, do this early. This means command 1000 1019 * line options (like --logfile &c) can't be introduced to affect … … 1041 1060 autostartSvcLogError("Failed to create release log file: %Rrc\n", rc); 1042 1061 } while (0); 1043 1044 /*1045 * Init com here for first main thread initialization.1046 * Service main function called in another thread1047 * created by service manager.1048 */1049 HRESULT hrc = com::Initialize();1050 # ifdef VBOX_WITH_XPCOM1051 if (hrc == NS_ERROR_FILE_ACCESS_DENIED)1052 {1053 char szHome[RTPATH_MAX] = "";1054 com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome));1055 return RTMsgErrorExit(RTEXITCODE_FAILURE,1056 "Failed to initialize COM because the global settings directory '%s' is not accessible!", szHome);1057 }1058 # endif1059 if (FAILED(hrc))1060 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM (%Rhrc)!", hrc);1061 1062 1062 1063 /* … … 1229 1230 return RTEXITCODE_FAILURE; 1230 1231 } 1231 1232 RTThreadSleep(10 * 1000);1233 1232 1234 1233 /*
Note:
See TracChangeset
for help on using the changeset viewer.