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



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


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.


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.


Reserved for use with future MSHCTX values.


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


Receives the standard marshaller.

Return Values


Indicates that the IMarshal instance was returned successfully.


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


Out of memory.


Indicates one or more arguments are invalid.


Indicates an unexpected error occurred.


Indicates an unspecified error.


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


Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database