TICKET 2619
If the service crashes unexpectedly (eg, when the network adapter list
changes) we should return an error code so that system policy can be
used to determine if the service should be automatically restarted.
When there is an error GlobalStatus gets set to a non-zero value.
If GlobalStatus is set, we will return ERROR_EXCEPTION_IN_SERVICE
to the Service Manager.
}
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
- ServiceStatus.dwWin32ExitCode = NO_ERROR;
+ ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;