[ros-diffs] [jimtabor] 54396: [Win32k|User32] - Patch by Shinobu Maehara: fix for kernel-mode/user-mode marshalling of WM_DDE_ACK.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Wed Nov 16 16:24:20 UTC 2011


Author: jimtabor
Date: Wed Nov 16 16:24:18 2011
New Revision: 54396

URL: http://svn.reactos.org/svn/reactos?rev=54396&view=rev
Log:
[Win32k|User32]
- Patch by Shinobu Maehara: fix for kernel-mode/user-mode marshalling of WM_DDE_ACK.

Modified:
    trunk/reactos/dll/win32/user32/windows/dialog.c
    trunk/reactos/dll/win32/user32/windows/message.c
    trunk/reactos/include/reactos/win32k/ntuser.h

Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/dialog.c?rev=54396&r1=54395&r2=54396&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Wed Nov 16 16:24:18 2011
@@ -288,7 +288,7 @@
         info->windowName = HeapAlloc( GetProcessHeap(), 0, sizeof(L"#65535") );
         if (info->windowName != NULL)
         {
-            swprintf((LPWSTR)info->windowName, L"#%d", GET_WORD(p + 1));
+            wsprintf((LPWSTR)info->windowName, L"#%d", GET_WORD(p + 1));
             info->windowNameFree = TRUE;
         }
         else

Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/message.c?rev=54396&r1=54395&r2=54396&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Wed Nov 16 16:24:18 2011
@@ -234,36 +234,24 @@
         {
           PKMDDELPARAM DdeLparam;
           DdeLparam = HeapAlloc(GetProcessHeap(), 0, sizeof(KMDDELPARAM));
-          if (NULL == DdeLparam)
+          if (NULL == DdeLparam || !UnpackDDElParam(
+          	UMMsg->message, UMMsg->lParam,
+          	&DdeLparam->uiLo, &DdeLparam->uiHi)) return FALSE;
+          /*
+          	If this is a reply to WM_DDE_EXECUTE then
+          	uiHi will contain a hMem, hence >= 0x10000.
+          	Otherwise, it will be be an atom, a 16-bit value.
+          */
+          if(DdeLparam->uiHi >= 0x10000)
             {
-              return FALSE;
-            }
-          if (Posted)
-            {
-              DdeLparam->Packed = TRUE;
-              if (! UnpackDDElParam(UMMsg->message, UMMsg->lParam,
-                                    &DdeLparam->Value.Packed.uiLo,
-                                    &DdeLparam->Value.Packed.uiHi))
-                {
-                  return FALSE;
-                }
-              if (0 != HIWORD(DdeLparam->Value.Packed.uiHi))
-                {
-                  /* uiHi should contain a hMem from WM_DDE_EXECUTE */
-                  HGLOBAL h = DdeGetPair((HGLOBAL)(ULONG_PTR)DdeLparam->Value.Packed.uiHi);
+              HGLOBAL h = DdeGetPair((HGLOBAL)(ULONG_PTR)DdeLparam->uiHi);
                   if (NULL != h)
                     {
-                      GlobalFree((HGLOBAL)(ULONG_PTR)DdeLparam->Value.Packed.uiHi);
-                      DdeLparam->Value.Packed.uiHi = (UINT_PTR) h;
+                  GlobalFree((HGLOBAL)(ULONG_PTR)DdeLparam->uiHi);
+                  DdeLparam->uiHi = (UINT_PTR) h;
                     }
                 }
               FreeDDElParam(UMMsg->message, UMMsg->lParam);
-            }
-          else
-            {
-              DdeLparam->Packed = FALSE;
-              DdeLparam->Value.Unpacked = UMMsg->lParam;
-            }
           KMMsg->lParam = (LPARAM) DdeLparam;
         }
         break;
@@ -376,17 +364,8 @@
       case WM_DDE_ACK:
         {
           PKMDDELPARAM DdeLparam = (PKMDDELPARAM) KMMsg->lParam;
-          if (DdeLparam->Packed)
-            {
-              UMMsg->lParam = PackDDElParam(KMMsg->message,
-                                            DdeLparam->Value.Packed.uiLo,
-                                            DdeLparam->Value.Packed.uiHi);
+          UMMsg->lParam = PackDDElParam(KMMsg->message, DdeLparam->uiLo, DdeLparam->uiHi);
             }
-          else
-            {
-              UMMsg->lParam = DdeLparam->Value.Unpacked;
-            }
-        }
         break;
 
       case WM_DDE_EXECUTE:

Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntuser.h?rev=54396&r1=54395&r2=54396&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Wed Nov 16 16:24:18 2011
@@ -488,7 +488,7 @@
 #define WNDS_HASCREATESTRUCTNAME     0X00020000
 #define WNDS_SERVERSIDEWINDOWPROC    0x00040000 // Call proc inside win32k.
 #define WNDS_ANSIWINDOWPROC          0x00080000
-#define WNDS_BEGINGACTIVATED         0x00100000
+#define WNDS_BEINGACTIVATED          0x00100000
 #define WNDS_HASPALETTE              0x00200000
 #define WNDS_PAINTNOTPROCESSED       0x00400000
 #define WNDS_SYNCPAINTPENDING        0x00800000
@@ -2692,15 +2692,15 @@
   HANDLE Handle,
   PICONINFO IconInfo);
 
+#if 0 // Correct type.
 BOOL
 NTAPI
 NtUserSetCursorIconData(
-  HANDLE Handle,
-  PBOOL fIcon,
-  POINT *Hotspot,
-  HMODULE hModule,
-  HRSRC hRsrc,
-  HRSRC hGroupRsrc);
+  HCURSOR hCursor,
+  PUNICODE_STRING ModuleName,
+  PUNICODE_STRING ResourceName,
+  PCURSORDATA pCursorData);
+#endif
 
 DWORD
 NTAPI
@@ -3178,16 +3178,8 @@
 
 typedef struct tagKMDDELPARAM
 {
-  BOOL Packed;
-  union
-    {
-      struct
-        {
           UINT_PTR uiLo;
           UINT_PTR uiHi;
-        } Packed;
-      LPARAM Unpacked;
-    } Value;
 } KMDDELPARAM, *PKMDDELPARAM;
 
 
@@ -3329,6 +3321,16 @@
   IN HWND hWnd,
   IN DWORD dwFlags);
 
+BOOL
+NTAPI
+NtUserSetCursorIconData(
+  HANDLE Handle,
+  PBOOL fIcon,
+  POINT *Hotspot,
+  HMODULE hModule,
+  HRSRC hRsrc,
+  HRSRC hGroupRsrc);
+
 typedef struct _SETSCROLLBARINFO
 {
   int nTrackPos;




More information about the Ros-diffs mailing list