MI_Deserializer_DeserializeInstance function (mi.h)

Deserializes a serialized buffer into a MI_Instance object.

Syntax

MI_INLINE MI_Result MI_Deserializer_DeserializeInstance(
  [in, out]       MI_Deserializer                   *deserializer,
                  MI_Uint32                         flags,
                  MI_Uint8                          *serializedBuffer,
                  MI_Uint32                         serializedBufferLength,
                  MI_Class                          **classObjects,
                  MI_Uint32                         numberClassObjects,
  [in, optional]  MI_Deserializer_ClassObjectNeeded classObjectNeeded,
  [in, out]       void                              *classObjectNeededContext,
  [out, optional] MI_Uint32                         *serializedBufferRead,
                  MI_Instance                       **instanceObject,
                  MI_Instance                       **cimErrorDetails
);

Parameters

[in, out] deserializer

A pointer to a deserializer object returned from a call to MI_Application_NewDeserializer. The deserializer must match the serializer that created the buffer.

flags

This parameter must be 0.

serializedBuffer

A serialized buffer that was filled via a call from MI_Serializer_SerializeClass.

serializedBufferLength

The length of the buffer that was reported via a call to MI_Serializer_SerializeClass.

classObjects

If the instance was serialized without class details, an array of pointers to all classes needed to rebuild the instance is needed. Otherwise, NULL can be passed.

numberClassObjects

Number of class objects in the classObjects array.

[in, optional] classObjectNeeded

A callback function used to provide a requested class object during deserialization. See MI_Deserializer_ClassObjectNeeded.

[in, out] classObjectNeededContext

A pointer to the context that is used with the callback function.

[out, optional] serializedBufferRead

The amount of the serialized buffer that was read (deserialized).

instanceObject

The returned deserialized instance. This class needs to be deleted via MI_Instance_Delete.

cimErrorDetails

If the call fails, this value will contain information useful in debugging. This value must be deleted via MI_Instance_Delete.

Return value

This function returns MI_INLINE MI_Result.

Remarks

Deserializing instances that have embedded object and reference object properties are a little more complex when the serialized instance does not have the class definition included in the serialized blob. When the class definition is included with the instance, this problem does not arise. When no class is given, the instance deserializer needs the pass the instance class, along with the class definitions for all embedded object and reference object properties. They can be included through the classObjects array parameter, or they can be queried for via the classObjectNeeded callback.

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