Expand Minimize

MI_Instance_GetClass function

Gets the MI_Class associated with an instance.

Syntax


 MI_INLINE MI_Result MI_Instance_GetClass(
  _In_  const MI_Instance *self,
  _Outptr_ MI_Class **instanceClass
);

Parameters

self [in]

A pointer to an instance whose MI_Class structure is to be retrieved.

instanceClass

Returned MI_Class. This MI_Class wraps the MI_ClassDecl field inside the MI_Instance and does not retrieve anything from the server. This returned class should be deleted via MI_Class_Delete.

Return value

A value of the MI_Result enumeration that specifies the function return code. This can be one of the following codes.

Return codeDescription
MI_RESULT_OK

The operation succeeded.

MI_RESULT_SERVER_LIMITS_EXCEEDED

There is not enough memory to complete the request.

MI_RESULT_INVALID_PARAMETER

One or more parameters passed to the function were not valid.

MI_RESULT_NOT_FOUND

Specified element does not exist.

MI_RESULT_FAILED

A failure not covered by other MI_Result error codes.

 

Remarks

Different types of classes exist. A dynamic instance has a very flat class declaration with no real qualifiers. Certain flags in to session objects can also change the type of runtime type information (RTTI) that is returned, such that it has none (types are all strings, flat structure, no qualifiers), basic (types of properties should be correct, but they are flat-structured without qualifiers), standard (best effort at creating hierarchy, but overloaded properties may not show original type in parent class), and full, which is an accurate class declaration. Therefore, how an instance is created or retrieved will depend on the accuracy of the class declaration.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Redistributable

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

Header

Mi.h

See also

MI_Class
MI_ClassDecl
MI_Instance
MI_Class_Delete

 

 

Show:
© 2014 Microsoft