SetServiceExitCode

The SetServiceExitCode function sets the service exit code.

Quick Info

Header file: WINWRAP.H
Library: WINWRAP.LIB

VOID SetServiceExitCode(
  DWORD dwWin32ExitCode,           
  DWORD dwServiceSpecificExitCode  
);
 

Parameters

dwWin32ExitCode
Input parameter. Win32 exit code.
dwServiceSpecificExitCode
Input parameter. Service-specific exit code

Return Values

See Return Values.

Remarks

The dwWin32ExitCode parameter specifies a Win32 error code that the service uses to report an error that occurs when starting or stopping. To return an error code specific to the service, the service must set this value to ERROR_SERVICE_SPECIFIC_ERROR to indicate that the dwServiceSpecificExitCode member contains the error code. The service should set this value to NO_ERROR when it is running and on normal termination.

The dwServiceSpecificExitCode parameter specifies a service specific error code that the service returns when an error occurs while the service is starting or stopping. This value is ignored unless the dwWin32ExitCode argument is set to ERROR_SERVICE_SPECIFIC_ERROR.

For more information on this function, see the SetServiceExitCode function in WINWRAP.C under the WINWRAP code sample in the Code Samples folder.

For more information on the WINWRAP library, see Using WINWRAP Functions, Mandatory Entry Points and Variables, and Events Signalled.

See Also

ServiceStop