CoGetStandardMarshal

HRESULT CoGetStandardMarshal(iid, pUnkObject, dwDestContext, pvDestContext, mshlflags, ppmarshal)

Return an IMarshal instance that knows how to do the standard marshaling and unmarshaling in order to create a proxy in the indicated destination context. Custom marshaling implementations should delegate to the marshaler here returned for destination contexts that they do not fully understand or for which they choose not to take special action. The standard marshaler is also used in the case that the object being marshaled does not support custom marshaling.

Argument

Type

Description

iid

REFIID

The interface id we would like to marshal.

pUnkObject

IUnknown*

The object that we want to marshal. It is specifically not the case that this interface is known to be of shape iid; rather, it can be any interface on the object which conforms to IUnknown. The standard marshaler will internally do a QueryInterface().

dwDestContext

DWORD

The destination context in which the unmarshaling will occur.

pvDestContext

void *

Associated with the destination context.

mshlflags

DWORD

The marshal flags for the marshaling operation.

ppmarshal

IMarshal **

The place at which the standard marshaler should be returned.

return value

HRESULT

S_OK, E_FAIL