ISMChangeServiceState

DWORD ISMChangeServiceState(
int nNewState,
int * pnCurrentState,
DWORD dwReserved,
LPCTSTR lpstrServers
);

Parameters:

nNewState

The requested state.

pnCurrentState

A pointer to the new state after the function call.

dwReserved

Reserved. Must be zero.

lpstrServers

A double null-terminated list of servers.

Return Values

The return value is a WIN32 error code. Additionally, the pnCurrentState value returns the current state of the service.

Remarks

This function is called to change the service state (running, stopped, paused) of the selected servers, provided service control is available. The nNewState parameter can be INetServiceStarted, INetServiceStopped, or INetServicePaused. The pnCurrentState parameter returns the current state of the service after the function returns, which may or may not be the same as the state requested. The dwReserved parameter is reserved for future use and must be zero. The lpstrServers parameter is a double null-terminated list of servers that the new state is to be applied to.