Author: gadamopoulos
Date: Sun May 16 11:32:51 2010
New Revision: 47238
URL:
http://svn.reactos.org/svn/reactos?rev=47238&view=rev
Log:
[user32]
-CreateWindow should fail when called with WS_EX_MDICHILD and the specified parent is not
an mdiclient
Modified:
trunk/reactos/dll/win32/user32/windows/window.c
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Sun May 16 11:32:51 2010
@@ -287,6 +287,18 @@
POINT mPos[2];
UINT id = 0;
HWND top_child;
+ PWND WndParent;
+ PCLS pcls;
+
+ if(!(WndParent = ValidateHwnd(hWndParent)) ||
+ !(pcls = DesktopPtrToUser(WndParent->pcls)))
+ return 0;
+
+ if (pcls->fnid != FNID_MDICLIENT)
+ {
+ ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n",
hWndParent);
+ return 0;
+ }
/* lpParams of WM_[NC]CREATE is different for MDI children.
* MDICREATESTRUCT members have the originally passed values.
@@ -399,6 +411,24 @@
POINT mPos[2];
UINT id = 0;
HWND top_child;
+ PWND WndParent;
+ PCLS pcls;
+
+ WndParent = ValidateHwnd(hWndParent);
+
+ if(!WndParent)
+ return 0;
+
+ pcls = DesktopPtrToUser(WndParent->pcls);
+
+ if(!pcls)
+ return 0;
+
+ if (pcls->fnid != FNID_MDICLIENT)
+ {
+ ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n",
hWndParent);
+ return 0;
+ }
/* lpParams of WM_[NC]CREATE is different for MDI children.
* MDICREATESTRUCT members have the originally passed values.