MI_Deserializer_DeserializeInstance function
Deserializes a serialized buffer into a MI_Instance object.
Syntax
MI_Result MI_Deserializer_DeserializeInstance(
_Inout_ MI_Deserializer *deserializer,
MI_Uint32 flags,
_In_reads_(serializedBufferLength) MI_Uint8 *serializedBuffer,
MI_Uint32 serializedBufferLength,
_In_reads_opt_(numberClassObjects) MI_Class **classObjects,
MI_Uint32 numberClassObjects,
_In_opt_ MI_Deserializer_ClassObjectNeeded classObjectNeeded,
_Inout_ void *classObjectNeededContext,
_Out_opt_ MI_Uint32 *serializedBufferRead,
_Outptr_opt_result_maybenull_ MI_Instance **instanceObject,
_Outptr_opt_result_maybenull_ MI_Instance **cimErrorDetails
);
Parameters
- deserializer [in, out]
-
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.
- classObjectNeeded [in, optional]
-
A callback function used to provide a requested class object during deserialization.
- classObjectNeededContext [in, out]
-
A pointer to the context that is used with the callback function.
- serializedBufferRead [out, optional]
-
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
| Value | Meaning |
|---|---|
|
Operation succeeded. |
|
Out of memory while carrying out the request. |
|
One or more parameters passed to the function were not valid. |
|
A failure not covered by other MI_Result error codes. |
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
|
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 |
|
Build date: 12/6/2012
