IMarshal::UnmarshalInterface method (objidl.h)
Unmarshals an interface pointer.
HRESULT UnmarshalInterface( [in] IStream *pStm, [in] REFIID riid, [out] void **ppv );
A pointer to the stream from which the interface pointer is to be unmarshaled.
A reference to the identifier of the interface to be unmarshaled.
The address of pointer variable that receives the interface pointer. Upon successful return, *ppv contains the requested interface pointer of the interface to be unmarshaled.
This method can return the standard return value E_FAIL, as well as the following values.
||The interface pointer was unmarshaled successfully.|
||The specified interface is not supported.|
The COM library in the process where unmarshaling is to occur calls the proxy's implementation of this method.CoUnmarshalInterface. For example, if you are implementing a stub, your implementation would call CoUnmarshalInterface when the stub receives an interface pointer as a parameter in a method call. IMarshal::MarshalInterface and use that data to initialize the proxy object whose CLSID was returned by the marshaling stub's call to the original object's implementation of IMarshal::GetUnmarshalClass.
To return the appropriate interface pointer, the proxy implementation can simply call QueryInterface on itself, passing the riid and ppv parameters. However, your implementation of UnmarshalInterface is free to create a different object and, if necessary, return a pointer to it.
Just before exiting, even if exiting with an error, your implementation should reposition the seek pointer in the stream immediately after the last byte of data read.
|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)|