QueryServiceDynamicInformation function advapi32

Win32Result<bool> QueryServiceDynamicInformation(
  1. SERVICE_STATUS_HANDLE hServiceStatus,
  2. int dwInfoLevel,
  3. Pointer<Pointer<NativeType>> ppDynamicInfo
)

Retrieves dynamic information related to the current service start.

To learn more, see learn.microsoft.com/windows/win32/api/winsvc/nf-winsvc-queryservicedynamicinformation.

Implementation

Win32Result<bool> QueryServiceDynamicInformation(
  SERVICE_STATUS_HANDLE hServiceStatus,
  int dwInfoLevel,
  Pointer<Pointer> ppDynamicInfo,
) {
  resolveGetLastError();
  final result_ = _QueryServiceDynamicInformation(
    hServiceStatus,
    dwInfoLevel,
    ppDynamicInfo,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}