From 50ec1d6849654224df3cc17cd9938b68577d6cba Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Mon, 8 May 2006 12:42:36 +0100 Subject: [PATCH] ole32: Add on the size of the whole OBJREF structure in the case of custom marshaling. --- dlls/ole32/marshal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 684d93d91e1..976d9e70b3f 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1450,13 +1450,13 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk, hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext, pvDestContext, mshlFlags, pulSize); - /* 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); + if (IsEqualCLSID(&marshaler_clsid, &CLSID_DfMarshal)) + /* add on the size of the common header */ + *pulSize += FIELD_OFFSET(OBJREF, u_objref); + else + /* custom marshaling: add on the size of the whole OBJREF structure + * like native does */ + *pulSize += sizeof(OBJREF); IMarshal_Release(pMarshal); return hr;