- 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.

svn path=/trunk/; revision=62746
This commit is contained in:
James Tabor 2014-04-14 05:43:02 +00:00
parent 142c547714
commit b07e61e478

View file

@ -1147,9 +1147,8 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd
if ( (Wnd->style & WS_MINIMIZE)) if ( (Wnd->style & WS_MINIMIZE))
{ {
UserGetInsideRectNC(Wnd, &rect); UserGetInsideRectNC(Wnd, &rect);
UserDrawSysMenuButton(hWnd, hdc, &rect, UserDrawSysMenuButton(hWnd, hdc, &rect, lpitem->fState & (MF_HILITE | MF_MOUSESELECT));
lpitem->fState & (MF_HILITE | MF_MOUSESELECT)); }
}
return; return;
} }
@ -1816,6 +1815,10 @@ LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM l
{ {
if (!pWnd->fnid) if (!pWnd->fnid)
{ {
if (Message != WM_NCCREATE)
{
return DefWindowProcA(Wnd, Message, wParam, lParam);
}
NtUserSetWindowFNID(Wnd, FNID_MENU); NtUserSetWindowFNID(Wnd, FNID_MENU);
} }
else else
@ -4264,9 +4267,16 @@ GetMenuInfo(HMENU hmenu,
{ {
ROSMENUINFO mi; ROSMENUINFO mi;
BOOL res = FALSE; BOOL res = FALSE;
PVOID pMenu;
if(!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) if (!(pMenu = ValidateHandle(hmenu, TYPE_MENU)))
return FALSE; return FALSE;
if (!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO)))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
RtlZeroMemory(&mi, sizeof(MENUINFO)); RtlZeroMemory(&mi, sizeof(MENUINFO));
mi.cbSize = sizeof(MENUINFO); mi.cbSize = sizeof(MENUINFO);