[This is preliminary documentation and subject to change.]
The QueryServiceConfig2 function retrieves the optional configuration parameters of the specified service.
BOOL QueryServiceConfig2(
SC_HANDLE hService,
DWORD dwInfoLevel,
LPBYTE lpBuffer,
DWORD cbBufSize,
LPDWORD pcbBytesNeeded
);
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: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winsvc.h.
Import Library: Use advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Services Overview, Service Functions, ChangeServiceConfig, ChangeServiceConfig2, CreateService, OpenService, QueryServiceConfig, SERVICE_DESCRIPTION, SERVICE_FAILURE_ACTIONS