user32: Make MDI get_client_info checks more strict

Dmitry Timoshkov dmitry at codeweavers.com
Mon Jun 18 04:39:19 CDT 2007


Hello,

an app I have here calls DefMDIChildProc in the wndproc of every window
it creates, even of a top level one.

Changelog:
    user32: Make MDI get_client_info checks more strict.

---
 dlls/user32/mdi.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index 5825220..40b910e 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -202,13 +202,15 @@ static MDICLIENTINFO *get_client_info( HWND client )
     WND *win = WIN_GetPtr( client );
     if (win)
     {
-        if (win == WND_OTHER_PROCESS)
+        if (win == WND_OTHER_PROCESS || win == WND_DESKTOP)
         {
-            if (IsWindow(client)) ERR( "client %p belongs to other process\n", client );
+            if (IsWindow(client)) WARN( "client %p belongs to other process\n", client );
             return NULL;
         }
-        if (win->cbWndExtra < sizeof(MDICLIENTINFO)) WARN( "%p is not an MDI client\n", client );
-        else ret = (MDICLIENTINFO *)win->wExtra;
+        if (win->flags & WIN_ISMDICLIENT)
+            ret = (MDICLIENTINFO *)win->wExtra;
+        else
+            WARN( "%p is not an MDI client\n", client );
         WIN_ReleasePtr( win );
     }
     return ret;
-- 
1.5.1.6






More information about the wine-patches mailing list