execNotificationQueryAsync method

void execNotificationQueryAsync(
  1. BSTR strQueryLanguage,
  2. BSTR strQuery,
  3. WBEM_GENERIC_FLAG_TYPE lFlags,
  4. IWbemContext? pCtx,
  5. IWbemObjectSink? pResponseHandler,
)

Performs the same task as IWbemServices.execNotificationQuery except that events are supplied to the specified response handler until CancelAsyncCall is called to stop the event notification.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/wbemcli/nf-wbemcli-iwbemservices-execnotificationqueryasync.

Implementation

@pragma('vm:prefer-inline')
void execNotificationQueryAsync(
  BSTR strQueryLanguage,
  BSTR strQuery,
  WBEM_GENERIC_FLAG_TYPE lFlags,
  IWbemContext? pCtx,
  IWbemObjectSink? pResponseHandler,
) {
  final hr$ = HRESULT(
    _ExecNotificationQueryAsyncFn(
      ptr,
      strQueryLanguage,
      strQuery,
      lFlags,
      pCtx?.ptr ?? nullptr,
      pResponseHandler?.ptr ?? nullptr,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}