CoGetMarshalSizeMax

HRESULT CoGetMarshalSizeMax(riid, pUnk, dwDestContext, pvDestContext, mshlfags, pulSize)

Return the number of bytes needed to marshal the given interface on the given object. On successful exit, the value pointed to by *pulSize will have been incremented by the number of bytes required.

This function is useful to custom marshaling implementations which themselves internally marshal interface pointers as part of their state.

Argument

Type

Description

riid

REFIID

The interface on the object which is to be marshaled.

pUnk

IUnknown*

An IUnknown (any old one) on the object.

dwDestContext

DWORD

The context into which the object is to be marshaled.

pvDestContext

void *

The context into which the object is to be marshaled.

mshlflags

DWORD

The marshal flags for the marshaling operation

pulSize

ULONG *

The place at which the required size is to be returned.

return value

HRESULT

S_OK, E_NOINTERFACE, E_OUTOFMEMORY, E_UNEXPECTED