deleteInstanceAsync method

void deleteInstanceAsync(
  1. BSTR strObjectPath,
  2. WBEM_GENERIC_FLAG_TYPE lFlags,
  3. IWbemContext? pCtx,
  4. IWbemObjectSink? pResponseHandler,
)

Asynchronously deletes an instance of an existing class in the current namespace.

The confirmation or failure of the operation is reported through the IWbemObjectSink interface implemented by the caller.

Throws a WindowsException on failure.

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

Implementation

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