MI_Instance_GetClass function (mi.h)

Gets the MI_Class associated with an instance.

Syntax

MI_INLINE MI_Result MI_INLINE_CALL MI_Instance_GetClass(
  [in] const MI_Instance *self,
       MI_Class          **instanceClass
);

Parameters

[in] self

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.

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

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_Class

MI_ClassDecl

MI_Class_Delete

MI_Instance