CoGetStdMarshalEx

Creates an aggregated standard marshaler for use with lightweight client-side handlers.

HRESULT CoGetStdMarshalEx(
  IUnknown * pUnkOuter,     //Pointer to the controlling IUnknown
  DWORD dwSMEXFlags,      //Indicates whether marshaler is client- or server-side
  IUnknown ** ppUnkInner,    //Address of IUnknown pointer on aggregated marshaler
);
 

Parameters

pUnkOuter
[in] Pointer to the controlling IUnknown.
dwSMEXFlags
[in] One of two values indicating whether the aggregated standard marshaler is on the client side or the server side. These flags are defined in the STDMSHFLAGS enumeration as follows:
typedef enum tagSTDMSHLFLAGS
{
    SMEXF_SERVER   = 0x01,  //server side aggregated std marshaler
    SMEXF_HANDLER  = 0x02  //client side (handler) agg std marshaler
} STDMSHLFLAGS; 
 
ppUnkInner
[out] On successful return, address of pointer to the IUnknown interface on the newly-created aggregated standard marshaler. If an error occurs, this value is NULL.

Return Values

S_OK
The standard marshaler was successfully created and aggregated with the proxy, and its IUnknown pointer was returned.

Remarks

The server calls CoGetStdMarshalEx passing in the flag SMEXF_SERVER. This creates a server side standard marshaler (a.k.a. a stub manager). The handler calls CoGetStdMarshalEx passing in the flag SMEXF_HANDLER. This creates a client side standard marshaler (a.k.a. a proxy manager). Note that when calling this API, the handler must pass the original controlling unknown that was passed to the handler when the handler was created. This will be the system implemented controlling unknown. Failure to pass the correct IUnknown results in an error returned. On success, the ppUnkInner returned is the controlling unknown of the inner object. The server and handler must keep this pointer, and may use it to call IUnknown::QueryInterface for the IMarshal interface.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in objbase.h.
  Import Library: Included as a resource in ole32.dll.

See Also

IStdMarshalInfo, IMarshal, Lightweight Client-side Handlers