Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method initializes a newly created proxy and returns an interface pointer to that proxy.

Syntax

HRESULT UnmarshalInterface(
  IStream* 
pStm,
  REFIID 
riid,
  void** 
ppv 
);

Parameters

pStm

[in] Pointer to the stream from which the interface pointer is to be unmarshaled.

riid

[in] Reference to the identifier of the interface to be unmarshaled.

ppv

[out] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, * ppvcontains the requested interface pointer of the interface to be unmarshaled.

Return Value

The method supports the standard return value E_FAIL, as well as the following:

S_OK

The interface pointer was unmarshaled successfully.

E_NOINTERFACE

The specified interface was not supported.

Remarks

The COM library in the process where unmarshaling is to occur calls the proxy's implementation of this method.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

You do not call this method directly. There are, however, some situations in which you might call it indirectly through a call to CoUnmarshalInterface. For example, if you are implementing a stub, your implementation would call CoUnmarshalInterfacewhen the stub receives an interface pointer as a parameter in a method call.

Notes to Implementers

The proxy's implementation should read the data written to the stream by the original object's implementation of IMarshal::MarshalInterfaceand 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 QueryInterfaceon itself, passing the riidand ppvparameters. However, your implementation of UnmarshalInterfaceis 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.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also