CoGetInterfaceAndReleaseStream

Unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshalled from another thread to the calling thread.

HRESULT CoGetInterfaceAndReleaseStream(

LPSTREAM * ppStm,
//Points to the stream from which the object is to be marshalled
REFIID riid,
//The interface requested from the unmarshalled object
LPVOID * ppv
//On return, location of the interface pointer
);

Parameters

pstm

Points to the stream containing the interface to be unmarshaled.

riid

Specifies the interface requested from the unmarshaled object.

ppv

[Out] On return, points to the location of the unmarshaled interface pointer.

Return Values

S_OK

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

E_INVALIDARG

Indicates that input arguments are invalid.

Other results from CoUnmarshalInterface

Comments

CoGetInterfaceAndReleaseStream
is a companion helper API to CoMarshalInterThreadInterfaceInStream, reversing the result of the latter. It unmarshals the buffer and releases the stream that contained the interface. If the unmarshaling fails, the stream is still released because there is no effective way to recover from a failure of this kind.

See Also

CoMarshalInterThreadInterfaceInStream

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database