MI_Serializer_SerializeClass function (mi.h)

Serializes an MI_Class into a buffer in the format specified when the serializer was created. Options can be passed into the flags to control if the class and all its parent classes are serialized, or just the child-most class.

Syntax

MI_INLINE MI_Result MI_Serializer_SerializeClass(
  [in, out] MI_Serializer  *serializer,
            MI_Uint32      flags,
  [in]      const MI_Class *classObject,
            MI_Uint8       *clientBuffer,
            MI_Uint32      clientBufferLength,
  [in, out] MI_Uint32      *clientBufferNeeded
);

Parameters

[in, out] serializer

Serializer returned from MI_Application_NewSerializer.

flags

Must be either 0 or MI_SERIALIZER_FLAGS_CLASS_DEEP. 0 means only the child most part of the class will be serialized. MI_SERIALIZER_FLAGS_CLASS_DEEP means all properties in the class will be serialized.

[in] classObject

Class object to be serialized.

clientBuffer

The output buffer to receive the serialized class data. If this parameter is Null, the required length of the buffer is passed back in clientBufferNeeded.

clientBufferLength

Length of the clientBuffer passed in. If clientBuffer is Null, this parameter should be 0.

[in, out] clientBufferNeeded

Returned total length the buffer needs to be. If a buffer is passed in (via the clientBuffer parameter) that is the required size or more, this value will indicate how much buffer was used. If a buffer was not passed in (where the clientBuffer value is Null) or the buffer is too small to hold the serialized class, this value will indicate how much space is needed to hold the serialized class.

Return value

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

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_NewSerializer