[This is preliminary documentation and subject to change.]
The IWbemServices::ExecMethod method executes a method exported by a CIM object. The method call is forwarded to the appropriate provider where it executes, and information and status are returned to the caller, which blocks until the circuit is complete.
Methods are not directly implemented by CIMOM, but are exported by method providers. For any given CIM class, the available methods and their parameters must be specified in the documentation for the provider in question.
HRESULT IWbemServices::ExecMethod(
[in] BSTR bstrObjectPath,
[in] BSTR MethodName,
[in] LONG lFlags,
[in] IWbemContext *pCtx,
[in] IWbemClassObject *pInParams,
[out, OPTIONAL] IWbemClassObject **ppOutParams,
[out, OPTIONAL] IWbemCallResult **ppCallResult
);
WBEM_E_FAILED | Other unspecified errors. |
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_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_INVALID_METHOD | The requested method was not available. |
WBEM_E_ACCESS_DENIED | The current user was not authorized to execute the method. |
WBEM_E_INVALID_METHOD_PARAMETERS | The supplied pInParams object was determined by the provider to be invalid. |
WBEM_NO_ERROR | The call succeeded. |
On failure, you can obtain any available information from the COM function GetErrorInfo.
IWbemServices::ExecMethodAsync, IWbemCallResult::GetResultObject