Changeset 89571 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 8, 2021 5:34:49 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxAutostart
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
r89359 r89571 45 45 #include <iprt/initterm.h> 46 46 #include <iprt/mem.h> 47 #include <iprt/message.h> 47 48 #include <iprt/process.h> 48 49 #include <iprt/path.h> … … 940 941 { 941 942 LogFlow(("autostartSvcWinServiceMain: calling autostartStartVMs\n")); 942 RTEXITCODE ec = autostartStartVMs(); 943 if (ec == RTEXITCODE_SUCCESS) 943 944 /* check if we should stopped already, e.g. windows shutdown */ 945 rc = RTSemEventMultiWait(g_hSupSvcWinEvent, 1); 946 if (RT_FAILURE(rc)) 944 947 { 945 LogFlow(("autostartSvcWinServiceMain: done string VMs\n")); 946 err = NO_ERROR; 947 rc = RTSemEventMultiWait(g_hSupSvcWinEvent, RT_INDEFINITE_WAIT); 948 if (RT_SUCCESS(rc)) 948 /* No one signaled us to stop */ 949 RTEXITCODE ec = autostartStartVMs(); 950 if (ec == RTEXITCODE_SUCCESS) 949 951 { 950 LogFlow(("autostartSvcWinServiceMain: woke up\n")); 951 /** @todo Autostop part. */ 952 LogFlow(("autostartSvcWinServiceMain: done starting VMs\n")); 952 953 err = NO_ERROR; 953 954 } 954 else 955 autostartSvcLogError("RTSemEventWait failed, rc=%Rrc", rc); 955 /* No reason to keep started. Shutdown the service*/ 956 956 } 957 958 957 autostartShutdown(); 959 958 } … … 1043 1042 } while (0); 1044 1043 1045 1044 /* 1045 * Init com here for first main thread initialization. 1046 * Service main function called in another thread 1047 * created by service manager. 1048 */ 1049 HRESULT hrc = com::Initialize(); 1050 # ifdef VBOX_WITH_XPCOM 1051 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 # endif 1059 if (FAILED(hrc)) 1060 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM (%Rhrc)!", hrc); 1046 1061 1047 1062 /* … … 1117 1132 break; 1118 1133 } 1134 1135 com::Shutdown(); 1136 1119 1137 return RTEXITCODE_FAILURE; 1120 1138 } -
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostartStart.cpp
r89360 r89571 175 175 } 176 176 } 177 g_pSession->UnlockMachine(); 177 SessionState_T enmSessionState; 178 CHECK_ERROR(g_pSession, COMGETTER(State)(&enmSessionState)); 179 if (SUCCEEDED(rc) && enmSessionState == SessionState_Locked) 180 g_pSession->UnlockMachine(); 178 181 } 179 182 }
Note:
See TracChangeset
for help on using the changeset viewer.