| 51 | static SERVICE_STATUS_HANDLE _ServiceStatusHandle(0); |
| 52 | |
| 53 | void ServerApplication::ServiceControlHandler(DWORD control) { |
| 54 | switch (control) { |
| 55 | case SERVICE_CONTROL_STOP: |
| 56 | case SERVICE_CONTROL_SHUTDOWN: |
| 57 | _ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; |
| 58 | SetServiceStatus(_ServiceStatusHandle, &_ServiceStatus); |
| 59 | _TerminateSignal.set(); |
| 60 | return; |
| 61 | case SERVICE_CONTROL_INTERROGATE: |
| 62 | break; |
| 63 | } |
| 64 | SetServiceStatus(_ServiceStatusHandle, &_ServiceStatus); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | BOOL ServerApplication::ConsoleCtrlHandler(DWORD ctrlType) { |