execMethodAsync method

void execMethodAsync(
  1. BSTR strObjectPath,
  2. BSTR strMethodName,
  3. WBEM_GENERIC_FLAG_TYPE lFlags,
  4. IWbemContext? pCtx,
  5. IWbemClassObject? pInParams,
  6. IWbemObjectSink? pResponseHandler,
)

Asynchronously executes a method exported by a CIM object.

Throws a WindowsException on failure.

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

Implementation

@pragma('vm:prefer-inline')
void execMethodAsync(
  BSTR strObjectPath,
  BSTR strMethodName,
  WBEM_GENERIC_FLAG_TYPE lFlags,
  IWbemContext? pCtx,
  IWbemClassObject? pInParams,
  IWbemObjectSink? pResponseHandler,
) {
  final hr$ = HRESULT(
    _ExecMethodAsyncFn(
      ptr,
      strObjectPath,
      strMethodName,
      lFlags,
      pCtx?.ptr ?? nullptr,
      pInParams?.ptr ?? nullptr,
      pResponseHandler?.ptr ?? nullptr,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}