[ros-diffs] [navaraf] 16735: Don't allow setting menu for child windows in IntSetMenu.

navaraf at svn.reactos.com navaraf at svn.reactos.com
Tue Jul 26 12:35:16 CEST 2005


Don't allow setting menu for child windows in IntSetMenu.
Modified: trunk/reactos/subsys/win32k/ntuser/window.c
  _____  

Modified: trunk/reactos/subsys/win32k/ntuser/window.c
--- trunk/reactos/subsys/win32k/ntuser/window.c	2005-07-26 08:55:25 UTC
(rev 16734)
+++ trunk/reactos/subsys/win32k/ntuser/window.c	2005-07-26 10:35:13 UTC
(rev 16735)
@@ -499,13 +499,19 @@

 {
   PMENU_OBJECT OldMenuObject, NewMenuObject = NULL;
 
+  if ((WindowObject->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
+    {
+      SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+      return FALSE;
+    }
+
   *Changed = (WindowObject->IDMenu != (UINT) Menu);
   if (! *Changed)
     {
       return TRUE;
     }
 
-  if (0 != WindowObject->IDMenu)
+  if (WindowObject->IDMenu)
     {
       OldMenuObject = IntGetMenuObject((HMENU) WindowObject->IDMenu);
       ASSERT(NULL == OldMenuObject || OldMenuObject->MenuInfo.Wnd ==
WindowObject->Self);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050726/3ae20361/attachment.html


More information about the Ros-diffs mailing list