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 function unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshaled from another thread to the calling thread.

Syntax

HRESULT CoGetInterfaceAndReleaseStream(
  LPSTREAM 
pStm,
  REFIID 
riid,
  LPVOID* 
ppv
);

Parameters

pStm

[in] Pointer to the IStreaminterface on the stream to be unmarshaled.

riid

[in] Reference to the identifier of the interface requested from the unmarshaled object.

ppv

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

Return Value

This function supports the standard return value E_INVALIDARG, as well as the following:

S_OK

Indicates the output interface was unmarshaled and the stream was released.

This function can also return any of the values returned by CoUnmarshalInterface.

Remarks

The CoGetInterfaceAndReleaseStreamfunction performs the following tasks:

  1. Calls CoUnmarshalInterfaceto unmarshal an interface pointer previously passed in a call to CoMarshalInterThreadInterfaceInStream.

  2. Releases the stream pointer. Even if the unmarshaling fails, the stream is still released because there is no effective way to recover from a failure of this kind.

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

Requirements

Header objbase.h
Library ole32.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

COM Functions