SQLSCMLocalServiceControl
Change the execution state of a supported service.
Prototypes
BOOL SQLSCMLocalServiceControl(LPSTR lpszSvc , int iCommand ,
LPDWORD pdwErr , int iCount , void* lpStartParameter );
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.
- iCommand
- Integer indicator of requested execution state change. Values are enumerated by the type enumSQLSCMCommands, and are: SQLSCMCmd_START, SQLSCMCmd_STOP, SQLSCMCmd_PAUSE, and SQLSCMCmd_CONTINUE.
- 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.
- iCount
- Integer number of parameters passed in lpStartParameter. Evaluated only when iCommand is SQLSCMCmd_START.
- lpStartParameter
- Pointer to an array of null-terminated character strings. Character width is determined by character width demanded by function version used. Each string in the array expresses a service startup option. Evaluated only when iCommand is SQLSCMCmd_START.
Returns
TRUE when successful. FALSE otherwise. When SQLSCMLocalServiceControl returns FALSE, the DWORD pointed to by pdwErr is filled.
Remarks
Service startup options are not supported for Windows 95/98. For Windows 95/98, the iCount and lpStartParameter arguments are ignored.
See Also
SQL Server Startup Options
(c) 1988-98 Microsoft Corporation. All Rights Reserved.