Merge 16735 from trunk:
Don't allow setting menu for child windows in IntSetMenu.
Modified:
branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c
_____
Modified:
branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c
--- branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c
2005-08-03 17:13:04 UTC (rev 17013)
+++ branches/ros-branch-0_2_7/reactos/subsys/win32k/ntuser/window.c
2005-08-03 17:13:51 UTC (rev 17014)
@@ -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);