IWbemServices::DeleteClassAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::DeleteClassAsync method deletes the specified class from the current namespace. This method is identical to IWbemServices::DeleteClass except that the call returns immediately. Confirmation or failure is asynchronously reported to the specified object sink using the IWbemObjectSink::SetStatus method after the operation has completed.

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

Parameters

bstrClass
The name of the class targeted for deletion.
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 an implementation of IWbemObjectSink implemented by the caller. This handler receives the status of the deletion request when it becomes available through the IWbemObjectSink::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 failures.
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 communications link between the current process and CIMOM has failed.
WBEM_NO_ERROR The call succeeded.

All other return codes are provided to the object sink specified by the pReponseHandler parameter through the SetStatus method. Error conditions, such as when the class does not exist or the user does not have permission to delete classes, are reported to the handler. They are not reported in the return code of this method.

Remarks

If a dynamic instance provider is associated with the class, the provider is unregistered, and is no longer called for that class. Any classes that derive from the deleted class are also deleted, and their associated providers become unregistered. All outstanding static instances of the specified class and its subclasses are also deleted when the class is deleted.

If the class is provided by a dynamic class provider, the success of the deletion depends on whether class deletion is supported by that provider.

Note  Standard system classes cannot be deleted.

See Also

Asynchronous Methods, IWbemServices::DeleteClass