Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CoGetInterfaceAndReleaseStream
Collapse the table of content
Expand the table of content

CoGetInterfaceAndReleaseStream 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(
  _In_  LPSTREAM pStm,
  _In_  REFIID   iid,
  _Out_ LPVOID   *ppv
);

Parameters

pStm [in]

A pointer to the IStream interface on the stream to be unmarshaled.

iid [in]

A reference to the identifier of the interface requested from the unmarshaled object.

ppv [out]

The address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppv contains the requested interface pointer to the unmarshaled interface.

Return value

This function can return the standard return values S_OK and E_INVALIDARG, as well as any of the values returned by CoUnmarshalInterface.

Remarks

The CoGetInterfaceAndReleaseStream function performs the following tasks:

  • Calls CoUnmarshalInterface to unmarshal an interface pointer previously passed in a call to CoMarshalInterThreadInterfaceInStream.
  • 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.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoMarshalInterThreadInterfaceInStream
CoUnmarshalInterface

 

 

Community Additions

ADD
Show:
© 2015 Microsoft