SQLSCMGetLocalServiceState

Determine the current execution state for a supported service.

Prototypes

DWORD SQLSCMGetLocalServiceState(LPSTR lpszSvc ,
LPDWORD pdwErr );

Arguments
lpszSvc
As-registered name of the target service as a null-terminated character string. For Microsoft® Windows NT®, lpszSvc can indicate any registered service. For Microsoft Windows® 95/98, the value must be MSSQLServer, SQLServerAgent, or MSDTC.
pdwErr
Pointer to a DWORD. Error code as defined by Microsoft Win32®. Value is returned only when SQLSCMLocalServiceControl returns FALSE. pdwErr can be NULL. When NULL, no attempt is made to return an error code to the application.
Returns

Nonzero on successful execution. Interpret a SQLSCMGetLocalServiceState successful execution return by using these values.

Return value Service state
SERVICE_STOPPED Stopped
SERVICE_START_PENDING Starting
SERVICE_STOP_PENDING Stopping
SERVICE_RUNNING Running
SERVICE_CONTINUE_PENDING Restarting after being paused
SERVICE_PAUSE_PENDING Pausing
SERVICE_PAUSED Paused

SERVICE_UNKNOWN on unsuccessful execution. When SQLSCMGetServiceState returns SERVICE_UNKNOWN, the DWORD pointed to by pdwErr is filled.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.