Index: win32ss/user/user32/windows/menu.c =================================================================== --- win32ss/user/user32/windows/menu.c (revision 62704) +++ win32ss/user/user32/windows/menu.c (working copy) @@ -4260,22 +4260,24 @@ */ BOOL WINAPI GetMenuInfo(HMENU hmenu, - LPMENUINFO lpcmi) + LPMENUINFO lpcmi) { - ROSMENUINFO mi; - BOOL res = FALSE; - - if(!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) - return FALSE; - - RtlZeroMemory(&mi, sizeof(MENUINFO)); - mi.cbSize = sizeof(MENUINFO); - mi.fMask = lpcmi->fMask; - - res = NtUserMenuInfo(hmenu, &mi, FALSE); - - memcpy(lpcmi, &mi, sizeof(MENUINFO)); - return res; + ROSMENUINFO mi; + BOOL res = FALSE; + + if(!hmenu || !lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + RtlZeroMemory(&mi, sizeof(MENUINFO)); + mi.cbSize = sizeof(MENUINFO); + mi.fMask = lpcmi->fMask; + + res = NtUserMenuInfo(hmenu, &mi, FALSE); + + memcpy(lpcmi, &mi, sizeof(MENUINFO)); + return res; }