Platform SDK: DLLs, Processes, and Threads |
The QueryServiceConfig2 function retrieves the optional configuration parameters of the specified service.
BOOL QueryServiceConfig2( SC_HANDLE hService, // handle to service DWORD dwInfoLevel, // information level LPBYTE lpBuffer, // buffer DWORD cbBufSize, // size of buffer LPDWORD pcbBytesNeeded // bytes needed );
Value | Meaning |
---|---|
SERVICE_CONFIG_DESCRIPTION | The lpBuffer parameter is a pointer to a SERVICE_DESCRIPTION structure. |
SERVICE_CONFIG_FAILURE_ACTIONS | The lpBuffer parameter is a pointer to a SERVICE_FAILURE_ACTIONS structure. |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The QueryServiceConfig2 function returns the optional configuration information stored in the service control manager database for the specified service. You can change this configuration information by using the ChangeServiceConfig2 function.
You can change and query additional configuration information using the ChangeServiceConfig and QueryServiceConfig functions, respectively.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Winsvc.h; include Windows.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.
Services Overview, Service Functions, ChangeServiceConfig, ChangeServiceConfig2, CreateService, OpenService, QueryServiceConfig, SERVICE_DESCRIPTION, SERVICE_FAILURE_ACTIONS