Author: jimtabor
Date: Mon Apr 14 05:43:02 2014
New Revision: 62746
URL:
http://svn.reactos.org/svn/reactos?rev=62746&view=rev
Log:
[User32]
- Patch by Victor Martinez Calvo : Fix Invalid parameter handling in GetMenuInfo and
SetLastError. Modified handle validation by me. See CORE-8064.
- Moved code and added a non-client create function ID.
Modified:
trunk/reactos/win32ss/user/user32/windows/menu.c
Modified: trunk/reactos/win32ss/user/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Mon Apr 14 05:43:02
2014
@@ -1147,9 +1147,8 @@
if ( (Wnd->style & WS_MINIMIZE))
{
UserGetInsideRectNC(Wnd, &rect);
- UserDrawSysMenuButton(hWnd, hdc, &rect,
- lpitem->fState & (MF_HILITE | MF_MOUSESELECT));
- }
+ UserDrawSysMenuButton(hWnd, hdc, &rect, lpitem->fState & (MF_HILITE
| MF_MOUSESELECT));
+ }
return;
}
@@ -1816,6 +1815,10 @@
{
if (!pWnd->fnid)
{
+ if (Message != WM_NCCREATE)
+ {
+ return DefWindowProcA(Wnd, Message, wParam, lParam);
+ }
NtUserSetWindowFNID(Wnd, FNID_MENU);
}
else
@@ -4264,9 +4267,16 @@
{
ROSMENUINFO mi;
BOOL res = FALSE;
-
- if(!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO)))
- return FALSE;
+ PVOID pMenu;
+
+ if (!(pMenu = ValidateHandle(hmenu, TYPE_MENU)))
+ return FALSE;
+
+ if (!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO)))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
RtlZeroMemory(&mi, sizeof(MENUINFO));
mi.cbSize = sizeof(MENUINFO);