Changeset 89359 in vbox for trunk/src/VBox/Frontends/VBoxAutostart
- Timestamp:
- May 28, 2021 1:44:11 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
r89322 r89359 257 257 DECLHIDDEN(void) autostartSvcOsLogStr(const char *pszMsg, AUTOSTARTLOGTYPE enmLogType) 258 258 { 259 /* write it to the release log too */ 260 LogRel(("%s", pszMsg)); 261 259 262 HANDLE hEventLog = RegisterEventSourceA(NULL /* local computer */, "VBoxAutostartSvc"); 260 263 AssertReturnVoid(hEventLog != NULL); … … 295 298 AssertMsg(fRc, ("%u\n", GetLastError())); NOREF(fRc); 296 299 DeregisterEventSource(hEventLog); 297 298 /* write it to the release log too */299 LogRel(("%s", pszMsg));300 300 } 301 301 … … 704 704 break; 705 705 default: 706 SvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; 706 SvcStatus.dwControlsAccepted 707 = SERVICE_ACCEPT_STOP 708 | SERVICE_ACCEPT_SHUTDOWN; 707 709 break; 708 710 } … … 738 740 autostartSvcWinServiceCtrlHandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID pvEventData, LPVOID pvContext) RT_NOTHROW_DEF 739 741 { 742 RT_NOREF(dwEventType); 743 RT_NOREF(pvEventData); 744 RT_NOREF(pvContext); 745 740 746 LogFlow(("autostartSvcWinServiceCtrlHandlerEx: dwControl=%#x dwEventType=%#x pvEventData=%p\n", 741 747 dwControl, dwEventType, pvEventData)); … … 754 760 * Request to stop the service. 755 761 */ 762 case SERVICE_CONTROL_SHUTDOWN: 756 763 case SERVICE_CONTROL_STOP: 757 764 { 765 if (dwControl == SERVICE_CONTROL_SHUTDOWN) 766 LogRel(("SERVICE_CONTROL_SHUTDOWN\n")); 767 else 768 LogRel(("SERVICE_CONTROL_STOP\n")); 769 758 770 /* 759 771 * Check if the real services can be stopped and then tell them to stop. 760 772 */ 761 773 autostartSvcWinSetServiceStatus(SERVICE_STOP_PENDING, 3000, NO_ERROR); 774 762 775 /* 763 776 * Notify the main thread that we're done, it will wait for the … … 772 785 } 773 786 774 case SERVICE_CONTROL_PAUSE:775 case SERVICE_CONTROL_CONTINUE:776 case SERVICE_CONTROL_SHUTDOWN:777 case SERVICE_CONTROL_PARAMCHANGE:778 case SERVICE_CONTROL_NETBINDADD:779 case SERVICE_CONTROL_NETBINDREMOVE:780 case SERVICE_CONTROL_NETBINDENABLE:781 case SERVICE_CONTROL_NETBINDDISABLE:782 case SERVICE_CONTROL_DEVICEEVENT:783 case SERVICE_CONTROL_HARDWAREPROFILECHANGE:784 case SERVICE_CONTROL_POWEREVENT:785 case SERVICE_CONTROL_SESSIONCHANGE:786 #ifdef SERVICE_CONTROL_PRESHUTDOWN /* vista */787 case SERVICE_CONTROL_PRESHUTDOWN:788 #endif789 787 default: 788 /* 789 * We only expect to receive controls we explicitly listed 790 * in SERVICE_STATUS::dwControlsAccepted. Logged in hex 791 * b/c WinSvc.h defines them in hex 792 */ 793 LogRel(("Unexpected service control message 0x%RX64\n", 794 (uint64_t)dwControl)); 790 795 return ERROR_CALL_NOT_IMPLEMENTED; 791 796 } 792 797 793 NOREF(dwEventType);794 NOREF(pvEventData);795 NOREF(pvContext);796 798 /* not reached */ 797 799 }
Note:
See TracChangeset
for help on using the changeset viewer.