MI_Session_Invoke function (mi.h)

Invokes a method in the provider.

Syntax

MI_INLINE void MI_Session_Invoke(
  [in]           MI_Session            *session,
                 MI_Uint32             flags,
  [in, optional] MI_OperationOptions   *options,
  [in, optional] const MI_Char         *namespaceName,
  [in, optional] const MI_Char         *className,
  [in]           const MI_Char         *methodName,
  [in, optional] const MI_Instance     *inboundInstance,
  [in, optional] const MI_Instance     *inboundProperties,
  [in, optional] MI_OperationCallbacks *callbacks,
  [out]          MI_Operation          *operation
);

Parameters

[in] session

Session handle returned from MI_Application_NewSession.

flags

Runtime type information (RTTI) flags.

[in, optional] options

Optional MI_OperationOptions value that specifies options such as timeouts and how to control the CIM semantics. Specify Null if no operation options are to be sent.

[in, optional] namespaceName

An optional, null-terminated string that represents the namespace name to carry out the operation. If none is specified, the server will pick a default. The namespace cannot include a computer name. It can only be in the form of a namespace name separated by a slash mark character (/). For example, the following would be a valid namespaceName value: root/cimv2.

[in, optional] className

An optional, null-terminated string that represents the name of the class the method is a part of. Should be Null when passing in an inboundinstance.

[in] methodName

A null-terminated string that represents the name of the method to invoke.

[in, optional] inboundInstance

Instance with keys to specify which method is to be invoked. If Null, the method must be static.

[in, optional] inboundProperties

Inbound method properties. Each inbound property needs to be an element in the instance and the element name needs to be the same as the name of the method parameter.

[in, optional] callbacks

Optional MI_OperationCallbacks structure that defines the operational callbacks to receive the instance result and CIM semantics. To carry out the operation asynchronously, the structure's instanceResult callback member must be specified. If this member is not specified, then the client must call the MI_Operation_GetInstance function to retrieve the results.

[out] operation

Returned operation handle that must be closed via MI_Operation_Close once complete. Calling MI_Operation_Cancel before it is complete will cause the operation to shutdown. MI_Operation_Close and MI_Operation_Cancel can be called from any operation.

Return value

None

Remarks

Methods have return values that will be returned as a ReturnValue parameter of the outbound instance. There may be outbound properties that will be part of the same result. If the streamed parameter callback is given and any outbound properties are marked as streamed, the streaming callback will be called for each parameter that supports streaming. They will be called until all results are retrieved or until the final result is given back.

Requirements

Requirement Value
Minimum supported client Windows 8
Minimum supported server Windows Server 2012
Target Platform Windows
Header mi.h
Redistributable Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2

See also

MI_Application_NewSession

MI_OperationCallbacks

MI_Operation_Cancel

MI_Operation_Close

MI_Operation_GetInstance