Returns an upper bound on the amount of data that would be written to the marshaling stream in a call to IMarshal::MarshalInterface.

HRESULT IMarshal::GetMarshalSizeMax(

REFIID riid,
//Identifies interface to be marshaled
void *pv,
//Points to interface pointer to be marshaled
DWORD dwDestContext,
//Identifies destination process
void * pvDestContext,
//Reserved for future use
DWORD mshlflags,
//Specifies reason for marshaling
ULONG * pSize
//Receives upper bound



[in]Specifies the IID of the interface pointer to be marshaled.


[in]Points to the interface pointer to be marshaled; can be NULL.


[in] Specifies the destination context, that is, the process in which the unmarshaling will be done. Different marshaling can be done depending on whether the unmarshaling will happen on the local workstation or on a workstation on the network; it's possible for an object to do custom marshaling in one case but not another. The legal values for dwDestContext are taken from the enumeration MSHCTX. For information on the MSHCTX enumeration, see the "Data Structures" section.


[in] Reserved for use with future MSHCTX values.


[in] Specifies why marshaling is taking place. The legal values for mshlflags are taken from the enumeration MSHLFLAGS. For information on the MSHLFLAGS enumeration, see the "Data Structures" section.


[out]Receives the upper bound on the amount of data that would be written to the marshaling stream.

Return Values


Maximum size was returned successfully.


Indicates that the implementation failed.


The specified interface was not supported.


This method is called from the originating side (that is, the side doing the marshaling). This method is used to preallocate the stream buffer that will be passed to IMarshal::MarshalInterface.

Notes to Implementors

The value your implementation returns must be an upper bound; a subsequent call to your implementation of IMarshal::MarshalInterface must use no more than the number of bytes returned by this method. The upper bound you return can be used by the caller to preallocate a stream buffer for using during marshaling.

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