MCPcopy Create free account
hub / github.com/Schnocker/NoEye / ServiceHandler

Function ServiceHandler

NoEye_Service/Service.cpp:86–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86VOID WINAPI ServiceHandler(DWORD CtrlCode)
87{
88 switch (CtrlCode)
89 {
90 case SERVICE_CONTROL_STOP:
91
92 if (g_ServiceStatus.dwCurrentState != SERVICE_RUNNING)
93 break;
94
95 g_ServiceStatus.dwControlsAccepted = 0;
96 g_ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
97 g_ServiceStatus.dwWin32ExitCode = 0;
98 g_ServiceStatus.dwCheckPoint = 4;
99
100 if (SetServiceStatus(g_StatusHandle, &g_ServiceStatus) == FALSE)
101 {
102 OutputDebugString("AmdK9: SetServiceStatus returned error");
103 }
104 SetEvent(g_ServiceStopEvent);
105 CloseHandle(g_ServiceStopEvent);
106 for (auto Thread : Threads)
107 {
108 TerminateThread(Thread, CtrlCode);
109 CloseHandle(Thread);
110 }
111
112 break;
113 default:
114 break;
115 }
116
117}
118
119DWORD WINAPI ServiceThread(LPVOID lpParam)
120{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected