Changeset 89320 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 27, 2021 1:59:25 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144667
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
r89319 r89320 907 907 LogFlowFuncEnter(); 908 908 909 #if 0 910 for (size_t i = 0; i < cArgs; ++i) 911 LogRel(("arg[%zu] = %ls\n", i, papwszArgs[i])); 912 #endif 913 909 914 /* 910 915 * Register the control handler function for the service and report to SCM. … … 917 922 if (autostartSvcWinSetServiceStatus(SERVICE_START_PENDING, 3000, NO_ERROR)) 918 923 { 919 if (cArgs == 1) 924 /* 925 * Create the event semaphore we'll be waiting on and 926 * then instantiate the actual services. 927 */ 928 int rc = RTSemEventMultiCreate(&g_hSupSvcWinEvent); 929 if (RT_SUCCESS(rc)) 920 930 { 921 931 /* 922 * Create the event semaphore we'll be waiting on and 923 * then instantiate the actual services. 932 * Update the status and enter the work loop. 924 933 */ 925 int rc = RTSemEventMultiCreate(&g_hSupSvcWinEvent); 926 if (RT_SUCCESS(rc)) 934 if (autostartSvcWinSetServiceStatus(SERVICE_RUNNING, 0, 0)) 927 935 { 928 /* 929 * Update the status and enter the work loop. 930 */ 931 if (autostartSvcWinSetServiceStatus(SERVICE_RUNNING, 0, 0)) 936 LogFlow(("autostartSvcWinServiceMain: calling autostartStartVMs\n")); 937 RTEXITCODE ec = autostartStartVMs(); 938 if (ec == RTEXITCODE_SUCCESS) 932 939 { 933 LogFlow(("autostartSvcWinServiceMain: calling autostartStartVMs\n")); 934 RTEXITCODE ec = autostartStartVMs(); 935 if (ec == RTEXITCODE_SUCCESS) 940 LogFlow(("autostartSvcWinServiceMain: done string VMs\n")); 941 err = NO_ERROR; 942 rc = RTSemEventMultiWait(g_hSupSvcWinEvent, RT_INDEFINITE_WAIT); 943 if (RT_SUCCESS(rc)) 936 944 { 937 LogFlow(("autostartSvcWinServiceMain: done string VMs\n")); 945 LogFlow(("autostartSvcWinServiceMain: woke up\n")); 946 /** @todo Autostop part. */ 938 947 err = NO_ERROR; 939 rc = RTSemEventMultiWait(g_hSupSvcWinEvent, RT_INDEFINITE_WAIT);940 if (RT_SUCCESS(rc))941 {942 LogFlow(("autostartSvcWinServiceMain: woke up\n"));943 /** @todo Autostop part. */944 err = NO_ERROR;945 }946 else947 autostartSvcLogError("RTSemEventWait failed, rc=%Rrc", rc);948 948 } 949 950 autostartShutdown();949 else 950 autostartSvcLogError("RTSemEventWait failed, rc=%Rrc", rc); 951 951 } 952 else 953 { 954 err = GetLastError(); 955 autostartSvcLogError("SetServiceStatus failed, err=%u", err); 956 } 957 958 RTSemEventMultiDestroy(g_hSupSvcWinEvent); 959 g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI; 952 953 autostartShutdown(); 960 954 } 961 955 else 962 autostartSvcLogError("RTSemEventMultiCreate failed, rc=%Rrc", rc); 956 { 957 err = GetLastError(); 958 autostartSvcLogError("SetServiceStatus failed, err=%u", err); 959 } 960 961 RTSemEventMultiDestroy(g_hSupSvcWinEvent); 962 g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI; 963 963 } 964 964 else 965 autostartSvcLog TooManyArgsError("main", cArgs, NULL, 0);965 autostartSvcLogError("RTSemEventMultiCreate failed, rc=%Rrc", rc); 966 966 } 967 967 else
Note:
See TracChangeset
for help on using the changeset viewer.