IMarshal::UnmarshalInterface

HRESULT IMarshal::UnmarshalInterface(pstm, iid, ppvInterface)

This is called as part of the unmarshaling process in order to initialize a newly created proxy; see the above sketch of the unmarshaling process for more details.

iid indicates the interface that the caller in fact would like to retrieve from this object; this interface instance is returned through ppvInterface. In order to support this, UnmarshalInterface will often merely do a QueryInterface(iid, ppvInterface) on itself immediately before returning, though it is free to create a different object (an object with a different identity) if it wishes.

On successful exit from this function, the seek pointer must be positioned immediately after the data read from the stream. On error exit, the seek pointer should still be in this location: even in the face of an error, the stream should be positioned as if the unmarshal were successful.

See also CoReleaseMarshalData.

Argument

Type

Description

pstm

IStream *

The stream from which the interface should be unmarshaled.

iid

REFIID

The interface that the caller ultimately wants from the object.

ppvInterface

void **

The place at which the interface the caller wants is to be returned.

return value

HRESULT

S_OK, E_FAIL, E_NOINTERFACE, E_UNEXPECTED