CoGetStandardMarshal

Returns an IMarshal pointer to the system's default marshalling implementation. Use this implementation to create a proxy for the specified interface pointer in another process.

STDAPI CoGetStandardMarshal(

REFIID riid,
//Identifies interface being marshalled
IUnknown * pUnk,
//Interface pointer being marshalled
DWORD dwDestContext,
//Specifies destination process
LPVOID pvDestContext,
//Reserved for future use
DWORD mshlflags,
//Specifies reason for marshalling
LPMARSHAL * ppMarshal
//Receives pointer to standard marshaller
);

Parameters

riid

Specifies the IID of the interface pointer to be marshalled. This interface must be derived from the IUnknown interface.

pUnk

Indicates interface pointer to be marshalled. This interface pointer does not have to have the same IID specified by the riid parameter; it can be a pointer to any IUnknown-derived interface on the object. The standard marshaller will call the QueryInterface function on this pointer requesting the interface specified by riid.

dwDestContext

Specifies the destination context, that is, the process in which the unmarshalling will be done. The legal values for dwDestContext are taken from the enumeration MSHCTX.

pvDestContext

Reserved for use with future MSHCTX values.

mshlflags

Specifies why marshalling is taking place. The legal values for mshlflags are taken from the enumeration MSHLFLAGS.

ppMarshal

Receives the standard marshaller.

Return Values

S_OK

Indicates that the IMarshal instance was returned successfully.

CO_E_NOTINITIALIZED

Indicates that the CoInitialize or OleInitialize function was not called on the current thread before this function was called.

E_OUTOFMEMORY

Out of memory.

E_INVALIDARG

Indicates one or more arguments are invalid.

E_UNEXPECTED

Indicates an unexpected error occurred.

E_FAIL

Indicates an unspecified error.

Comments

You typically do not need to call this function. If you are performing custom marshalling (that is, writing your own implementation of IMarshal), you can delegate certain destination contexts to the standard marshaller. You should delegate any destination contexts that you don't fully understand or don't want to handle. The standard marshaller returned by this function is the one used by OLE when an object does not support the IMarshal interface.

See Also

IMarshal

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