3.1.4.3.23 IWbemServices::ExecMethodAsync (Opnum 25)

The IWbemServices::ExecMethodAsync method asynchronously executes a CIM method that is implemented by a CIM class or a CIM instance that is retrieved from the IWbemServices interface.

 HRESULT ExecMethodAsync(
   [in] const BSTR strObjectPath,
   [in] const BSTR strMethodName,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [in] IWbemClassObject* pInParams,
   [in] IWbemObjectSink* pResponseHandler
 );

strObjectPath: MUST be the CIM path to the class or instance that implements the method. This parameter MUST NOT be NULL. The CIM path MUST contain the class name and the value of the key properties.

strMethodName: MUST be the name of the method to be executed. This parameter MUST NOT be NULL.

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

Value

Meaning

WBEM_FLAG_SEND_STATUS

0x00000080

If this bit is not set, the server MUST make just one final IWbemObjectSink::SetStatus call on the interface pointer that is provided in the pResponseHandler parameter.

If this bit is set, the server MAY make intermediate IWbemObjectSink::SetStatus calls on the interface pointer prior to call completion.

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.

pInParams: MUST be a pointer to an IWbemClassObject interface pointer, which MUST contain an instance of input parameter CIM class as defined in [MS-WMIO] (section 2.3.3), with method parameter values set as properties. This parameter MUST be NULL when the method has no input parameters.

pResponseHandler: MUST be a pointer to an IWbemObjectSink interface object that is implemented by the client of this method. This parameter MUST NOT be 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 (as specified in section 2.2.11) to indicate the successful completion of the method.

WBEM_S_NO_ERROR (0x00)

The following validation occurs before asynchronous operation is started.

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

Requirements mentioned in the parameter definitions are also checked before the asynchronous operation is started.

If successful, the server MUST create a new entry in AsyncOperationTable as specified in section 3.1.1.1.3.

The following validation happens asynchronously.

In response to IWbemServices::ExecMethodAsync, the server MUST evaluate strObjectPath and strMethodName (as specified in this section) and MUST execute the method that is identified by strMethodName, implemented by the strObjectPath CIM object. The server MUST use the input parameters to the CIM method from the pInParams parameter, which is an instance of the input parameter CIM class as defined in [MS-WMIO] (section 2.3.3). The server MUST execute the CIM method and send the output parameters as an instance of the output parameter CIM class as defined in [MS-WMIO] (section 2.3.3). The method MUST fail if the method parameters or their combinations are not valid, as specified earlier in this section, or if the server is unable to execute the method.

If the strMethodName has "disabled" qualifier set to true, then the server MUST return WBEM_E_METHOD_DISABLED. If the strMethodName is not implemented by the CIM class as pointed by the strObjectPath, the server MUST return WBEM_E_METHOD_NOT_IMPLEMENTED.