Export (0) Print
Expand All
Expand Minimize

CoMarshalInterThreadInterfaceInStream (Windows Embedded CE 6.0)

1/6/2010

This function marshals an interface pointer from one thread to another thread in the same process.


HRESULT CoMarshalInterThreadInterfaceInStream(
  REFIID riid,
  LPUNKNOWN pUnk,
  LPSTREAM* ppStm
);

riid

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

pUnk

[in] Pointer to the interface to be marshaled, which must be derived from IUnknown; can be NULL.

ppStm

[out] Address of IStream* pointer variable that receives the interface pointer to the stream that contains the marshaled interface.

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

S_OK

The interface was marshaled successfully.

The CoMarshalInterThreadInterfaceInStream function enables an object to easily and reliably marshal an interface pointer to another thread in the same process.

The stream returned in ppStm is guaranteed to behave correctly when a client running in the receiving thread attempts to unmarshal the pointer. The client can then call the CoGetInterfaceAndReleaseStream to unmarshal the interface pointer and release the stream object.

The CoMarshalInterThreadInterfaceInStream function performs the following tasks:

  1. Creates a stream object.
  2. Passes the stream object's IStream pointer to CoMarshalInterface.
  3. Returns the IStream pointer to the caller.

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

Headerobjbase.h
Libraryole32.lib
Windows Embedded CEWindows CE 3.0 and later

Community Additions

ADD
Show:
© 2014 Microsoft