QueryServiceDynamicInformation function (winsvc.h)

Retrieves dynamic information related to the current service start.

Syntax

BOOL QueryServiceDynamicInformation(
  [in] SERVICE_STATUS_HANDLE hServiceStatus,
  [in] DWORD                 dwInfoLevel,
       PVOID                 *ppDynamicInfo
);

Parameters

[in] hServiceStatus

A service status handle provided by RegisterServiceCtrlHandlerEx

[in] dwInfoLevel

Indicates the information level.

Value Meaning
SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON
Indicates a request for dynamic information related to the current service start.

ppDynamicInfo

A dynamic information buffer. If this parameter is valid, the callback function must free the buffer after use with the LocalFree function.

Return value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. When this happens the GetLastError function should be called to retrieve the error code.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header winsvc.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See also

ChangeServiceConfig

ChangeServiceConfig2

CreateService

OpenService

QueryServiceConfig

QueryServiceConfig2

QueryServiceObjectSecurity

Service Configuration

Service Functions