IWbemServices::ExecMethodAsync

[This is preliminary documentation and subject to change.]

The IWbemServices::ExecMethodAsync method asynchronously executes a method exported by a CIM object. The call immediately returns to the client while the inbound parameters are forwarded to the appropriate provider where it executes. Information and status are returned to the caller through the supplied object sink.

Methods are not directly implemented by CIMOM, but are exported by method providers. For any given CIM class, the available methods and their parameters are part of the documentation for the provider in question.

HRESULT IWbemServices::ExecMethodAsync(
  [in] BSTR bstrObjectPath,                   
  [in] BSTR bstrMethodName,
  [in] LONG lFlags,                       
  [in] IWbemContext *pCtx,                 
  [in] IWbemClassObject *pInParams,
  [in] CALLBACK *pResponseHandler
);
 

Parameters

bstrObjectPath
A valid BSTR containing the object path of the object for which the method is to be executed.
bstrMethodName
The name of the method for the object.
lFlags
Reserved. It must be zero.
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.
pInParams
Can be NULL if no inbound parameters are required to execute the method. Otherwise, this points to an IWbemClassObject that contains the properties acting as inbound parameters for the method execution. The contents of the object are method-specific, and are part of the specification for the provider in question.
pResponseHandler
Must not be NULL. The object sink receives the result of the method call. The outbound parameters are sent to IWbemObjectSink::Indicate .The result of the call mechanism itself will be sent to IWbemObjectSink::SetStatus. Notice that IWbemObjectSink::SetStatus does not receive the return code of the CIM method. However, it receives the return code of the actual call-return mechanism, and is only useful for verifying that the call occurred or that it failed for mechanical reasons. The result code returned from the CIM method is returned in the outbound parameter object supplied to IWbemObjectSink::Indicate.

Return Values

WBEM_E_FAILED Other unspecified errors.
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 client and CIMOM has failed.
WBEM_E_ACCESS_DENIED The current user was not authorized to execute the method.
WBEM_NO_ERROR The call succeeded.

On failure, you can obtain any available information from the COM function GetErrorInfo.

Other errors will be reported asynchronously to the object sink supplied in the pReponseHandler parameter

See Also

IWbemServices::ExecMethod