Author: jimtabor
Date: Sat Mar 26 23:12:01 2016
New Revision: 71059

URL: http://svn.reactos.org/svn/reactos?rev=71059&view=rev
Log:
[User32]
- Fix crash by use of MDI container rules.
- Patch by Michael Müller: Preserve beginning of extra data for MDI windows.
- Patch by Jacek Caban : Ignore WM_CHILDACTIVATE on disabled windows in 
DefMDIChildProc.
- CORE-10912 Wine Staging 1.9.4

Modified:
    trunk/reactos/win32ss/include/ntuser.h
    trunk/reactos/win32ss/user/user32/windows/mdi.c

Modified: trunk/reactos/win32ss/include/ntuser.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?rev=71059&r1=71058&r2=71059&view=diff
==============================================================================
--- trunk/reactos/win32ss/include/ntuser.h      [iso-8859-1] (original)
+++ trunk/reactos/win32ss/include/ntuser.h      [iso-8859-1] Sat Mar 26 
23:12:01 2016
@@ -730,6 +730,15 @@
     UINT wDisableFlags;
     SBCALC SBCalc;
 } SBWND, *PSBWND;
+
+typedef struct _MDIWND
+{
+  WND wnd;
+  DWORD dwReserved;
+  PVOID pmdi;
+} MDIWND, *PMDIWND;
+
+#define GWLP_MDIWND 4
 
 typedef struct _MENUWND
 {

Modified: trunk/reactos/win32ss/user/user32/windows/mdi.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows/mdi.c?rev=71059&r1=71058&r2=71059&view=diff
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/mdi.c     [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/mdi.c     [iso-8859-1] Sat Mar 26 
23:12:01 2016
@@ -112,6 +112,7 @@
      * states it must keep coherency with USER32 on its own. This is true for
      * Windows as well.
      */
+    LONG      reserved;
     UINT      nActiveChildren;
     HWND      hwndChildMaximized;
     HWND      hwndActiveChild;
@@ -216,7 +217,7 @@
     0,                      /* style */
     MDIClientWndProcA,      /* procA */
     MDIClientWndProcW,      /* procW */
-    sizeof(MDICLIENTINFO),  /* extra */
+    sizeof(MDIWND),         /* extra */
     IDC_ARROW,              /* cursor */
     (HBRUSH)(COLOR_APPWORKSPACE+1)    /* brush */
 };
@@ -225,7 +226,7 @@
 static MDICLIENTINFO *get_client_info( HWND client )
 {
 #ifdef __REACTOS__
-    return (MDICLIENTINFO *)GetWindowLongPtr(client, 0);
+    return (MDICLIENTINFO *)GetWindowLongPtr(client, GWLP_MDIWND);
 #else
     MDICLIENTINFO *ret = NULL;
     WND *win = WIN_GetPtr( client );
@@ -1123,7 +1124,7 @@
 #ifdef __REACTOS__
           if (!(ci = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 
sizeof(*ci))))
              return FALSE;
-           SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
+           SetWindowLongPtrW( hwnd, GWLP_MDIWND, (LONG_PTR)ci );
            ci->hBmpClose = 0;
            NtUserSetWindowFNID( hwnd, FNID_MDICLIENT); // wine uses 
WIN_ISMDICLIENT
 #else
@@ -1174,7 +1175,7 @@
           HeapFree( GetProcessHeap(), 0, ci->frameTitle );
 #ifdef __REACTOS__
           HeapFree( GetProcessHeap(), 0, ci );
-          SetWindowLongPtrW( hwnd, 0, 0 );
+          SetWindowLongPtrW( hwnd, GWLP_MDIWND, 0 );
 #endif
           return 0;
       }
@@ -1592,7 +1593,8 @@
         break;
 
     case WM_CHILDACTIVATE:
-        MDI_ChildActivate( client, hwnd );
+        if (IsWindowEnabled( hwnd ))
+            MDI_ChildActivate( client, hwnd );
         return 0;
 
     case WM_SYSCOMMAND:


Reply via email to