[This is preliminary documentation and subject to change.]
The IWbemServices::DeleteInstance method deletes the instance specified in the object path. Only instances in the current namespace can be deleted.
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::DeleteInstance(
[in] BSTR bstrObjectPath,
[in] LONG lFlags,
[in] IWbemContext *pCtx,
[out, OPTIONAL] IWbemCallResult **ppCallResult
);
WBEM_E_ACCESS_DENIED | The current context does not have adequate rights to delete the object. |
WBEM_E_FAILED | Other unspecified errors. |
WBEM_E_INVALID_CLASS | The specified class does not exist. |
WBEM_E_INVALID_OPERATION | The object cannot be deleted. |
WBEM_E_NOT_FOUND | The object did not exist. |
WBEM_E_OUT_OF_MEMORY | There was not enough memory to complete the operation. |
WBEM_E_TRANSPORT_FAILURE | The communications link between CIMOM and the client has failed. |
WBEM_NO_ERROR | The call succeeded. |
On failure, you can obtain any available information from the COM function GetErrorInfo.
Error Objects, IWbemCallResult, IWbemServices::DeleteInstanceAsync, Object Paths