| 243 | |
| 244 | |
| 245 | static USHORT report_status(DWORD state, DWORD exit_code, DWORD checkpoint, DWORD hint) |
| 246 | { |
| 247 | /************************************** |
| 248 | * |
| 249 | * r e p o r t _ s t a t u s |
| 250 | * |
| 251 | ************************************** |
| 252 | * |
| 253 | * Functional description |
| 254 | * Report our status to the control manager. |
| 255 | * |
| 256 | **************************************/ |
| 257 | SERVICE_STATUS status; |
| 258 | |
| 259 | status.dwServiceType = (SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS); |
| 260 | status.dwServiceSpecificExitCode = 0; |
| 261 | |
| 262 | if (state == SERVICE_START_PENDING) |
| 263 | status.dwControlsAccepted = 0; |
| 264 | else |
| 265 | status.dwControlsAccepted = SERVICE_ACCEPT_STOP; |
| 266 | |
| 267 | status.dwCurrentState = current_state = state; |
| 268 | status.dwWin32ExitCode = exit_code; |
| 269 | status.dwCheckPoint = checkpoint; |
| 270 | status.dwWaitHint = hint; |
| 271 | |
| 272 | const USHORT ret = SetServiceStatus(service_handle, &status); |
| 273 | if (!ret) |
| 274 | CNTL_shutdown_service("SetServiceStatus"); |
| 275 | |
| 276 | return ret; |
| 277 | } |
no test coverage detected