IWbemServices::PutClassAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::PutClassAsync method creates a new class, or it updates an existing one. The class specified by the pObject parameter must be correctly initialized with all of the required property values. The call immediately returns. Success or failure is supplied to the object sink specified by the pResponseHandler parameter.

HRESULT IWbemServices::PutClassAsync(
  [in] IWbemClassObject *pObject,    
  [in] LONG lFlags,                 
  [in] IWbemContext *pCtx,           
  [in] CALLBACK *pResponseHandler   
);
 

Parameters

pObject
Points to the object containing the class definition.
lFlags
If WBEM_FLAG_CREATE_OR_UPDATE, the class is created if it does not exist, or it is overwritten if it exists already. If WBEM_FLAG_UPDATE_ONLY, then the class must exist, and this call constitutes an update. If WBEM_FLAG_CREATE_ONLY, then this call is for creation only, and the call fails if the class already exists.
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 Put request when it becomes available using the SetStatus method. For a detailed explanation of this parameter, see Asynchronous Methods. CIMOM only calls AddRef to 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_ACCESS_DENIED The current user does not have permission to create classes.
WBEM_E_ALREADY_EXISTS WBEM_FLAG_CREATE_ONLY flag was specified but the class already exists.
WBEM_E_FAILED Unspecified failure.
WBEM_E_INVALID_CLASS
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_NOT_FOUND WBEM_FLAG_UPDATE_ONLY flag was specified, but the class does not exist.
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.

Other status or error codes are reported to the object sink specified by the pReponseHandler parameter.

See Also

Asynchronous Methods, Class Creation and Modification Rules, IWbemServices::PutClass