SERVICE_CONTROL_STATUS_REASON_PARAMSW structure (winsvc.h)
Contains service control parameters.
Syntax
typedef struct _SERVICE_CONTROL_STATUS_REASON_PARAMSW {
DWORD dwReason;
LPWSTR pszComment;
SERVICE_STATUS_PROCESS ServiceStatus;
} SERVICE_CONTROL_STATUS_REASON_PARAMSW, *PSERVICE_CONTROL_STATUS_REASON_PARAMSW;
Members
dwReason
The reason for changing the service status to SERVICE_CONTROL_STOP. If the current control code is not SERVICE_CONTROL_STOP, this member is ignored.
This member must be set to a combination of one general code, one major reason code, and one minor reason code.
The following are the general reason codes.
The following are the major reason codes.
The following are the minor reason codes.
pszComment
An optional string that provides additional information about the service stop. This string is stored in the event log along with the stop reason code. This member must be NULL or a valid string that is less than 128 characters, including the terminating null character.
ServiceStatus
A pointer to a SERVICE_STATUS_PROCESS structure that receives the latest service status information. The information returned reflects the most recent status that the service reported to the service control manager.
The service control manager fills in the structure only when ControlServiceEx returns one of the following error codes: NO_ERROR, ERROR_INVALID_SERVICE_CONTROL, ERROR_SERVICE_CANNOT_ACCEPT_CTRL, or ERROR_SERVICE_NOT_ACTIVE. Otherwise, the structure is not filled in.
Remarks
Note
The winsvc.h header defines SERVICE_CONTROL_STATUS_REASON_PARAMS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Header | winsvc.h (include Windows.h) |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for