[This is preliminary documentation and subject to change.]
The IWbemServices::DeleteClass method deletes the specified class from the current namespace. If a dynamic instance provider is associated with the class, the provider is unregistered, and it is no longer called for that class. Any classes that derive from the deleted class are also deleted, and their associated providers are 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 System classes cannot be deleted.
HRESULT IWbemServices::DeleteClass(
[in] BSTR bstrClass,
[in] LONG lFlags,
[in] IWbemContext *pCtx,
[out, OPTIONAL] IWbemCallResult **ppCallResult
);
See Error Objects.
WBEM_E_ACCESS_DENIED | The current user does not have permission to delete classes. |
WBEM_E_FAILED | Other unspecified errors. |
WBEM_E_INVALID_CLASS | The specified class does not exist. |
WBEM_E_INVALID_OPERATION | Deletion is not supported for the specified class. It may have been a system class or a class supplied by a dynamic provider that does not support class deletion. |
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. |
On failure, you can obtain any available information from the COM function GetErrorInfo.
Error Objects, IWbemServices::DeleteClassAsync