IWbemServices::PutInstanceAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::PutInstanceAsync method performs the same task as IWbemServices::PutInstance except that the call returns immediately, and update confirmation or error reporting is provided to the specified response handler.

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

Parameters

pInst
Points to the instance to be written to the database. The caller cannot make assumptions about the reference count at the completion of this call. The operating system can either call AddRef to the pointer, or it can leave the reference count unchanged.
lFlags
If WBEM_FLAG_CREATE_OR_UPDATE, the instance is created if it does not exist, or it is overwritten if it exists already. If WBEM_FLAG_UPDATE_ONLY, then the instance 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 instance 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 IWbemClassObject::Put operation when it becomes available using 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_ALREADY_EXISTS WBEM_FLAG_CREATE_ONLY flag was specified, but the instance already exists.
WBEM_E_FAILED Other unspecified errors.
WBEM_E_ILLEGAL_NULL A NULL value was specified for a property that is not NULL, such as one marked by a key, indexed, or not_null qualifier.
WBEM_E_INVALID_CLASS The specified class was invalid.
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 instance does not exist.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_E_RPC_FAILURE The RPC link between the client and CIMOM has failed.
WBEM_NO_ERROR The call succeeded.

See Also

Asynchronous Methods, IWbemContext, IWbemServices::PutInstance, Instance Creation and Modification Rules