MI_Session_ReferenceInstances function

Finds the association object that references the specified key instance.


 MI_INLINE void MI_Session_ReferenceInstances(
  _In_           MI_Session               *session,
                 MI_Uint32                flags,
  _In_opt_       MI_OperationOptions      *options,
                 _In_opt_z_ const MI_Char *namespaceName,
  _In_     const MI_Instance              *instanceKey,
                 _In_opt_z_ const MI_Char *resultClass,
                 _In_opt_z_ const MI_Char *role,
                 MI_Boolean               keysOnly,
  _In_opt_       MI_OperationCallbacks    *callbacks,
  _Out_          MI_Operation             *operation


session [in]

Session handle returned from MI_Application_NewSession.


Runtime type information (RTTI) flags.

options [in, optional]

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.


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.

instanceKey [in]

An MI_Instance that represents the class name and the keys of the instance where the reference operation is to start.


An optional, null-terminated string that represents the value that restricts the result set to only this association class. Specify Null if no filtering is wanted.


An optional, null-terminated string that represents the value that specifies which property name in the association class to use to reference the key class.


Boolean value where MI_TRUE means to retrieve only the instance keys. Otherwise, all properties will be retrieved.

callbacks [in, optional]

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 that structure member is not specified, the client must call the MI_Operation_GetInstance function to retrieve the results.

operation [out]

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.


An association is a relationship between two objects. It is represented with a third object containing two properties, each being a reference to one of those two related objects. The role parameter is the association object's reference property, pointing to the object being associated.

The difference between this function and the MI_Session_AssociatorInstances function is that this function looks for the association object itself, while the MI_Session_AssociatorInstances function looks for the instances associated with the key object.


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012


Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2



See also