mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 16:18:43 +00:00
- check if the requested MenuItem object was really found
- makes user32_winetest not crash reactos svn path=/trunk/; revision=33361
This commit is contained in:
parent
89ac2632f2
commit
6208860a11
|
@ -930,7 +930,7 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition,
|
||||||
{
|
{
|
||||||
int pos = (int)uItem;
|
int pos = (int)uItem;
|
||||||
PMENU_ITEM MenuItem;
|
PMENU_ITEM MenuItem;
|
||||||
PMENU_OBJECT SubMenu;
|
PMENU_OBJECT SubMenu = NULL;
|
||||||
|
|
||||||
if (MAX_MENU_ITEMS <= MenuObject->MenuInfo.MenuItemCount)
|
if (MAX_MENU_ITEMS <= MenuObject->MenuInfo.MenuItemCount)
|
||||||
{
|
{
|
||||||
|
@ -951,6 +951,13 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition,
|
||||||
{
|
{
|
||||||
pos = IntGetMenuItemByFlag(MenuObject, uItem, MF_BYCOMMAND, &SubMenu, NULL, NULL);
|
pos = IntGetMenuItemByFlag(MenuObject, uItem, MF_BYCOMMAND, &SubMenu, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
if (SubMenu == NULL)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pos < -1)
|
if (pos < -1)
|
||||||
{
|
{
|
||||||
pos = -1;
|
pos = -1;
|
||||||
|
|
Loading…
Reference in a new issue