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

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 8 09:06:19 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 50ec1d6849654224df3cc17cd9938b68577d6cba
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=50ec1d6849654224df3cc17cd9938b68577d6cba

Author: Robert Shearman <rob at codeweavers.com>
Date:   Mon May  8 12:42:36 2006 +0100

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

---

 dlls/ole32/marshal.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 684d93d..976d9e7 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -1450,13 +1450,13 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG
 
     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;




More information about the wine-cvs mailing list