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.
Value
Meaning
SERVICE_STOP_REASON_FLAG_CUSTOM
0x20000000
The reason code is defined by the user. If this flag is not present, the reason code is defined by the system. If this flag is specified with a system reason code, the function call fails.
Users can create custom major reason codes in the range SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM (0x00400000) through SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM (0x00ff0000) and minor reason codes in the range SERVICE_STOP_REASON_MINOR_MIN_CUSTOM (0x00000100) through SERVICE_STOP_REASON_MINOR_MAX_CUSTOM (0x0000FFFF).
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 that 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 is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.