Alexandre Julliard : user32: Pack the structure for WM_DDE_ACK to allow crossing 32/64 boundaries.

Alexandre Julliard julliard at winehq.org
Wed Mar 31 10:04:49 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 30 20:42:09 2010 +0200

user32: Pack the structure for WM_DDE_ACK to allow crossing 32/64 boundaries.

---

 dlls/user32/message.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index a2401e4..b93c703 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2000,8 +2000,9 @@ static BOOL post_dde_message( struct packed_message *data, const struct send_mes
             HGLOBAL h = dde_get_pair( (HANDLE)uiHi );
             if (h)
             {
+                ULONGLONG hpack = pack_ptr( h );
                 /* send back the value of h on the other side */
-                push_data( data, &h, sizeof(HGLOBAL) );
+                push_data( data, &hpack, sizeof(hpack) );
                 lp = uiLo;
                 TRACE( "send dde-ack %lx %08lx => %p\n", uiLo, uiHi, h );
             }
@@ -2102,11 +2103,13 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
     case WM_DDE_ACK:
         if (size)
         {
+            ULONGLONG hpack;
             /* hMem is being passed */
-            if (size != sizeof(HGLOBAL)) return FALSE;
+            if (size != sizeof(hpack)) return FALSE;
             if (!buffer || !*buffer) return FALSE;
             uiLo = *lparam;
-            memcpy( &hMem, *buffer, size );
+            memcpy( &hpack, *buffer, size );
+            hMem = unpack_ptr( hpack );
             uiHi = (UINT_PTR)hMem;
             TRACE("recv dde-ack %lx mem=%lx[%lx]\n", uiLo, uiHi, GlobalSize( hMem ));
         }




More information about the wine-cvs mailing list