MCPcopy Create free account
hub / github.com/dobin/RedEdr / ServiceCtrlHandler

Function ServiceCtrlHandler

RedEdrPplService/RedEdrPplService.cpp:42–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41
42VOID WINAPI ServiceCtrlHandler(DWORD ctrlCode)
43{
44 switch (ctrlCode)
45 {
46 case SERVICE_CONTROL_STOP:
47 if (g_ServiceStatus.dwCurrentState != SERVICE_RUNNING)
48 break;
49 LOG_W(LOG_INFO, L"Service stop requested");
50 ShutdownService();
51 break;
52
53 case SERVICE_CONTROL_INTERROGATE:
54 // Return current status
55 SetServiceStatus(g_StatusHandle, &g_ServiceStatus);
56 break;
57
58 default:
59 LOG_W(LOG_INFO, L"Unhandled service control code: %d", ctrlCode);
60 break;
61 }
62}
63
64
65// Real service main()

Callers

nothing calls this directly

Calls 2

ShutdownServiceFunction · 0.85
LOG_WFunction · 0.70

Tested by

no test coverage detected