CoGetStaticMarshal

[This is preliminary documentation and subject to change.]

Creates a stub manager, also called a marshaler, aggregates the marshaler in a server object, and creates a map of interface pointer IDs (IPIDs) to interface IDs.

WINOLEAPI CoGetStaticMarshal(
  IUnknown *pUnkControl,  //Server object
  DWORD dwFlags,          //Reserved for future use
  ULONG cItfs,            //Size of arIIDs and arIPIDs
  IID **arIIDs,           //Array of IIDs
  UUID **arIPIDs,         //Corresponding array of IPIDs
  ULONG cBindings,        //Size of pBindings
  LPUNKNOWN *pBindings,   //Array of COM binding objects
  IUnknown **ppUnkInner   //Marshaler
);

Parameters

pUnkControl
Pointer to the controlling IUnknown interface on the server object that aggregates the marshaler.
dwFlags
Reserved for future use; must be 0.
cItfs
Number of elements in the arIIDs and arIPIDs arrays.
arIIDs
Array of IDs of interfaces exposed on the server object.
arIPIDs
Array of static IPIDs on the server object, which correspond to the IIDs in arIIDs.
cBindings
Size of the arBindings array.
pBindings
Array of COM binding objects, each of which describes an endpoint.
ppUnkInner
Address of a pointer to the IUnknown interface on the marshaler. QueryInterface calls for the IMarshal interface should be made through this pointer.

Return Values

This function supports the standard return values E_FAIL, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

S_OK
The marshaler was created and the interfaces were mapped.

Remarks

The server object calls CoGetStaticMarshal when it is created. CoGetStaticMarshal creates a stub manager and aggregates it into the server object. The server object is responsible for delegating IMarshal method calls to this stub manager.

CoGetStaticMarshal also maps an array of static interface pointer IDs (IPIDs) to a corresponding array of interface IDs (IIDs). In this mapping, an IPID identifies a specific instance of the interface on the server that corresponds to the interface specified by the corresponding IID.

Endpoints must be specified by passing an array of COM binding objects in the pBindings parameter. An endpoint on a process and an IPID identifying an interface pointer are sufficient to fully identify an object. Because static IPIDs do not change, the resulting proxy can marshal calls without requesting interface pointers from the server object, resulting in fewer network round trips and faster performance for each marshaled call.

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

IComBinding