MI_Serializer_SerializeClass function
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_Result MI_Serializer_SerializeClass(
_Inout_ MI_Serializer *serializer,
MI_Uint32 flags,
_In_ const MI_Class *classObject,
_Out_writes_bytes_(clientBufferLength) MI_Uint8 *clientBuffer,
MI_Uint32 clientBufferLength,
_Inout_ MI_Uint32 *clientBufferNeeded
);
Parameters
- serializer [in, out]
-
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.
- classObject [in]
-
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.
- clientBufferNeeded [in, out]
-
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.
| Return code | Description |
|---|---|
|
The operation succeeded. |
|
There is not enough memory to complete the request. |
|
One or more parameters passed to the function were not valid. |
|
A failure not covered by other MI_Result error codes. |
Requirements
|
Minimum supported client | Windows 8 [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [desktop apps only] |
|
Redistributable | Windows Management Framework 3.0 on Windows Server 2008 R2 with SP1, Windows 7 with SP1, and Windows Server 2008 with SP2 |
|
Header |
|
See also
Build date: 12/6/2012