IWbemServices::DeleteInstanceAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::DeleteInstanceAsync method performs the same function as IWbemServices::DeleteInstance except that the call returns immediately, and the confirmation or failure of the operation is asynchronously reported to the supplied object sink through the IWbemObjectSink::SetStatus method.

If the instance was supplied by a dynamic provider, it is sometimes not possible to delete the instance unless the provider supports instance deletion.

HRESULT IWbemServices::DeleteInstanceAsync(
  [in] BSTR bstrObjectPath,                   
  [in] LONG lFlags,                       
  [in] IWbemContext *pCtx,                 
  [in] CALLBACK *pResponseHandler         
);
 

Parameters

bstrObjectPath
A valid BSTR containing the object path of the object to be deleted.
lFlags
Reserved. It must be zero.
pCtx
Typically NULL. Otherwise, this is a pointer to an IWbemContext object required by the dynamic class provider that is producing the class instances. The values in the context object must be specified in the documentation for the provider in question.
pResponseHandler
Points to the caller's implementation of IWbemObjectSink. This handler receives the status of the delete operation as it becomes available through the SetStatus method. For a detailed explanation of this parameter, see Asynchronous Methods. CIMOM only calls AddRef on the pointer in cases where WBEM_NO_ERROR is returned. In cases where an error code is returned, the reference count is the same as on entry.

Return Values

WBEM_E_FAILED Other unspecified errors.
WBEM_E_INVALID_CLASS The specified class was invalid.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_TRANSPORT_FAILURE The remote link between the client and CIMOM has failed.
WBEM_NO_ERROR The call succeeded.

On failure, you can obtain any available information from the COM function GetErrorInfo.

Other error conditions are reported asynchronously to the object sink supplied by the pResponseHandler parameter.

See Also

Asynchronous Methods, IWbemServices::DeleteInstance, Object Paths