IMarshal::ReleaseMarshalData method (objidl.h)
Destroys a marshaled data packet.
HRESULT ReleaseMarshalData( [in] IStream *pStm );
A pointer to a stream that contains the data packet to be destroyed.
This method can return the standard return values S_OK and E_FAIL, as well as any of the stream-access errors for the IStream interface.
If an object's marshaled data packet does not get unmarshaled in the client process space and the packet is no longer needed, the client calls ReleaseMarshalData on the proxy's IMarshal implementation to instruct the object to destroy the data packet. The call occurs within the CoReleaseMarshalData function. The data packet serves as an additional reference on the object, and releasing the data is like releasing an interface pointer by calling Release.
If the marshaled data packet somehow does not arrive in the client process or if ReleaseMarshalData is not successfully re-created in the proxy, COM can call this method on the object itself.IMarshal on a class factory for a class object on which you are also implementing IMarshal. In this case, if you were marshaling the object to a table where it could be retrieved by multiple clients, you might, as part of your unmarshaling routine, call ReleaseMarshalData to release the data packet for each proxy.
|Minimum supported client||Windows 2000 Professional [desktop apps | UWP apps]|
|Minimum supported server||Windows 2000 Server [desktop apps | UWP apps]|
|Header||objidl.h (include ObjIdl.h)|