When debugging, a console event handler that simulates a service stop control.
| 1025 | // When debugging, a console event handler that simulates a service |
| 1026 | // stop control. |
| 1027 | BOOL WINAPI DebugControlHandler ( DWORD dwCtrlType ) |
| 1028 | { |
| 1029 | switch( dwCtrlType ) |
| 1030 | { |
| 1031 | case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate |
| 1032 | case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in debug mode |
| 1033 | { |
| 1034 | _tprintf(TEXT("Stopping debug service.\n")); |
| 1035 | // simulate a stop even to each service |
| 1036 | PY_SERVICE_TABLE_ENTRY *ppy = PythonServiceTable; |
| 1037 | SERVICE_TABLE_ENTRY *ps = DispatchTable; |
| 1038 | while (ps->lpServiceName) { |
| 1039 | service_ctrl_ex(SERVICE_CONTROL_STOP, 0, NULL, ppy); |
| 1040 | ppy++; |
| 1041 | ps++; |
| 1042 | } |
| 1043 | return TRUE; |
| 1044 | break; |
| 1045 | } |
| 1046 | |
| 1047 | } |
| 1048 | return FALSE; |
| 1049 | } |
| 1050 | |
| 1051 | /************************************************************************* |
| 1052 | * |
nothing calls this directly
no test coverage detected