3.1.4.3.8 IWbemServices::DeleteClass (Opnum 10)

The IWbemServices::DeleteClass method MUST delete a specified class from the namespace that is associated with the current IWbemServices interface.

 HRESULT DeleteClass(
   [in] const BSTR strClass,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [out, in, unique] IWbemCallResult** ppCallResult
 );

strClass: MUST be the name of the class to delete. This parameter MUST NOT be NULL.

lFlags: Specifies the behavior of the DeleteClass method. Flag behavior MUST be interpreted as specified in the following table.

Value

Meaning

WBEM_FLAG_RETURN_IMMEDIATELY

0x00000010

If this bit is set, the server MUST make the method call semisynchronously.

If this bit is not set, the server MUST make the method call synchronously.

Any other DWORD value that does not match the preceding condition MUST be treated as invalid.

pCtx: MUST be a pointer to an IWbemContext interface, which MUST contain additional information that the client wants to pass to the server. If pCtx is NULL, the parameter MUST be ignored.

ppCallResult: The output parameter MUST be filled according to the state of the lFlags parameter (whether WBEM_FLAG_RETURN_IMMEDIATELY is set) as listed in the following table.

Flag state

Operation Started Successfully

Operation Failed to Start

WBEM_FLAG_RETURN_IMMEDIATELY is not set.

MUST be set to IWbemCallResult if the ppCallResult input parameter is non-NULL.

MUST be set to NULL if the ppCallResult input parameter is non-NULL.

WBEM_FLAG_RETURN_IMMEDIATELY is set.

The ppCallResult parameter MUST NOT be NULL upon input. If NULL, the server MUST return WBEM_E_INVALID_PARAMETER. On output, the parameter MUST contain the IWbemCallResult interface pointer.

MUST be set to NULL if the ppCallResult input parameter is non-NULL.

Return Values: This method MUST return an HRESULT value that MUST indicate the status of the method call. The server MUST return WBEM_S_NO_ERROR (specified in section 2.2.11) to indicate the successful completion of the method.

WBEM_S_NO_ERROR (0x00)

The security principal that makes the call MUST have WBEM_REMOTE_ENABLE and WBEM_ENABLE accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

If the CIM class being deleted is dynamic, the security principal that makes the call MUST have WBEM_WRITE_PROVIDER access to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

If the CIM class being deleted is static, the security principal that makes the call MUST have WBEM_FULL_WRITE access to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

If the CIM class being deleted is dynamic, the server MUST obtain SupportsDelete for the given provider in the ProviderTable. If SupportsDelete is FALSE, the server MUST return WBEM_E_PROVIDER_NOT_CAPABLE.

In response to the IWbemServices::DeleteClass method, the server MUST evaluate the strClass parameter (specified in this section) and MUST delete the strClass parameter from the current namespace. The server MUST delete all the instances of the class and recursively delete all the derived classes. The method MUST fail if the following applies: if strClass does not exist; if the method parameters or their combinations are not valid as specified in this section; or if the server is unable to execute the method.

The successful synchronous method execution MUST return WBEM_S_NO_ERROR.

The semisynchronous method execution MUST follow the rules that are specified in section 3.1.1.1.2.

The failed method execution MUST set output parameters to NULL and MUST return an error in the format specified in section 2.2.11.

If the ppResult input parameter is non-NULL, the server MUST deliver the result of the requested operation (regardless whether WBEM_FLAG_RETURN_IMMEDIATELY is set) via the IWbemCallResult, similar to the semisynchronous execution case. If the ppCallResult input parameter is NULL and WBEM_FLAG_RETURN_IMMEDIATELY is not set, the server MUST deliver the result of the requested operation synchronously.

If a class is deleted, the corresponding entries for the class and its derived classes MUST be deleted from the ClassTable.

The server MUST generate a __ClassDeletionEvent event object upon successfully deleting the class information.

The server SHOULD enforce a maximum length for the strClass parameter, and return WBEM_E_QUOTA_VIOLATION if the limit is exceeded.<38>