Huw Davies : ole32: Explicitly add the three ULONGs from the METAFILEPICT struct to allow for padding in the 64-bit version .

Alexandre Julliard julliard at winehq.org
Fri May 22 08:25:34 CDT 2009


Module: wine
Branch: master
Commit: 485811cf9c745041d97164063897c6ea17276ef9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=485811cf9c745041d97164063897c6ea17276ef9

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri May 22 11:51:31 2009 +0100

ole32: Explicitly add the three ULONGs from the METAFILEPICT struct to allow for padding in the 64-bit version.

---

 dlls/ole32/usrmarshal.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c
index 98e0691..46fba8b 100644
--- a/dlls/ole32/usrmarshal.c
+++ b/dlls/ole32/usrmarshal.c
@@ -1390,7 +1390,7 @@ ULONG __RPC_USER HMETAFILEPICT_UserSize(ULONG *pFlags, ULONG StartingSize, HMETA
             METAFILEPICT *mfpict = GlobalLock(*phMfp);
 
             /* FIXME: raise an exception if mfpict is NULL? */
-            size += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
+            size += 3 * sizeof(ULONG);
             size += sizeof(ULONG);
 
             size = HMETAFILE_UserSize(pFlags, size, &mfpict->hMF);
@@ -1451,7 +1451,7 @@ unsigned char * __RPC_USER HMETAFILEPICT_UserMarshal(ULONG *pFlags, unsigned cha
             remmfpict->mm = mfpict->mm;
             remmfpict->xExt = mfpict->xExt;
             remmfpict->yExt = mfpict->yExt;
-            pBuffer += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
+            pBuffer += 3 * sizeof(ULONG);
             *(ULONG *)pBuffer = USER_MARSHAL_PTR_PREFIX;
             pBuffer += sizeof(ULONG);
 
@@ -1518,7 +1518,7 @@ unsigned char * __RPC_USER HMETAFILEPICT_UserUnmarshal(ULONG *pFlags, unsigned c
             mfpict->mm = remmfpict->mm;
             mfpict->xExt = remmfpict->xExt;
             mfpict->yExt = remmfpict->yExt;
-            pBuffer += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
+            pBuffer += 3 * sizeof(ULONG);
             user_marshal_prefix = *(ULONG *)pBuffer;
             pBuffer += sizeof(ULONG);
 




More information about the wine-cvs mailing list