SERVICE_STATUS

typedef struct _SERVICE_STATUS {

DWORD dwServiceType;

DWORD dwCurrentState;

DWORD dwControlsAccepted;

DWORD dwWin32ExitCode;

DWORD dwServiceSpecificExitCode;

DWORD dwCheckPoint;

DWORD dwWaitHint;

} SERVICE_STATUS, *LPSERVICE_STATUS;

Members

dwServiceType

Value to indicate the type of service this is.

Value Meaning

SERVICE_WIN32 a service which runs in a Win32 process.
SERVICE_DRIVER an NT device driver.

dwCurrentState

Value which indicates the current state of a service.

Value Meaning

SERVICE_STOPPED Service is not running.
SERVICE_START_PENDING Service is starting.
SERVICE_STOP_PENDING Service is stopping.
SERVICE_RUNNING Service is running.
SERVICE_CONTINUE_PENDING Service continue is pending.
SERVICE_PAUSE_PENDING Service pause is pending.
SERVICE_PAUSED Service is paused.

dwControlsAccepted

Value which indicates the controls which the service will accept and process.

Value Meaning

SERVICE_ACCEPT_STOP Service can be stopped.
SERVICE_ACCEPT_PAUSE_CONTINUE Service can be paused and continued.

dwWin32ExitCode

Win32 error code which indicates the cause of service termination. This value is used by the service to report the reason for start or shutdown failure. The service should set this value to NO_ERROR when it is running and on normal termination. If a service rather return an error code which is specific to the service, this value must be set to ERROR_SERVICE_SPECIFIC_ERROR to indicate that there is a service specific error code returned in dwServiceSpecificExitCode.

dwServiceSpecificExitCode

Service specific error code which is returned when the service has encountered a start or shutdown failure. This value is ignored unless dwWin32ExitCode is set to ERROR_SERVICE_SPECIFIC_ERROR.

dwCheckPoint

Value which is periodically incremented by the service to show progress to the user interface program while running in a lengthy pending state. This value is not valid and should be 0 when the service is not in a pending state.

dwWaitHint

Hint time value in number of milliseconds for an existing pending operation to complete. The user interface program waits this amount of time before checking to see if the service has completed its pending operation. If not, it looks at dwCheckPoint to make sure that it had been incremented, i.e. the service is not hung, before it waits this amount of time again. This value is not valid and should be 0 when the service is not in a pending state.