ole32: Add on the size of the whole OBJREF structure in the case of custom marshaling.

This commit is contained in:
Robert Shearman 2006-05-08 12:42:36 +01:00 committed by Alexandre Julliard
parent 340f7a3ec0
commit 50ec1d6849
1 changed files with 7 additions and 7 deletions

View File

@ -1450,13 +1450,13 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk,
hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext,
pvDestContext, mshlFlags, pulSize);
if (IsEqualCLSID(&marshaler_clsid, &CLSID_DfMarshal))
/* add on the size of the common header */
*pulSize += FIELD_OFFSET(OBJREF, u_objref);
/* if custom marshaling, add on size of custom header */
if (!IsEqualCLSID(&marshaler_clsid, &CLSID_DfMarshal))
*pulSize += FIELD_OFFSET(OBJREF, u_objref.u_custom.pData) -
FIELD_OFFSET(OBJREF, u_objref.u_custom);
else
/* custom marshaling: add on the size of the whole OBJREF structure
* like native does */
*pulSize += sizeof(OBJREF);
IMarshal_Release(pMarshal);
return hr;