/* Initialise status */\r
ZeroMemory(&service->status, sizeof(service->status));\r
service->status.dwServiceType = SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS;\r
- service->status.dwControlsAccepted = SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE;\r
+ service->status.dwControlsAccepted = 0;\r
service->status.dwWin32ExitCode = NO_ERROR;\r
service->status.dwServiceSpecificExitCode = 0;\r
service->status.dwCheckPoint = 0;\r
so abandon the wait before too much time has elapsed.\r
*/\r
service->status.dwCurrentState = SERVICE_START_PENDING;\r
+ service->status.dwControlsAccepted = SERVICE_ACCEPT_POWEREVENT | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP;\r
if (await_single_handle(service->status_handle, &service->status, service->process_handle, service->name, _T("start_service"), service->throttle_delay) == 1) service->throttle = 0;\r
\r
/* Signal successful start */\r
service->status.dwCurrentState = SERVICE_RUNNING;\r
+ service->status.dwControlsAccepted &= ~SERVICE_ACCEPT_PAUSE_CONTINUE;\r
SetServiceStatus(service->status_handle, &service->status);\r
\r
/* Continue waiting for a clean startup. */\r
if (graceful) {\r
service->status.dwCurrentState = SERVICE_STOP_PENDING;\r
service->status.dwWaitHint = NSSM_WAITHINT_MARGIN;\r
- SetServiceStatus(service->status_handle, &service->status);\r
}\r
+ service->status.dwControlsAccepted = 0;\r
+ SetServiceStatus(service->status_handle, &service->status);\r
\r
/* Nothing to do if service isn't running */\r
if (service->pid) {\r
}\r
\r
service->status.dwCurrentState = SERVICE_PAUSED;\r
+ service->status.dwControlsAccepted |= SERVICE_ACCEPT_PAUSE_CONTINUE;\r
SetServiceStatus(service->status_handle, &service->status);\r
\r
if (use_critical_section) {\r