- when menu position cannot be found insert new item at the end
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 9 May 2008 18:11:40 +0000 (18:11 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Fri, 9 May 2008 18:11:40 +0000 (18:11 +0000)
- reduces winetest failures from 1550 to 1250
- behaviour verified on Windows Vista

svn path=/trunk/; revision=33400

reactos/subsystems/win32/win32k/ntuser/menu.c

index c7f0f12..1bd8d2f 100644 (file)
@@ -953,8 +953,9 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition,
    }
    if (SubMenu == NULL)
    {
-       SetLastWin32Error(ERROR_INVALID_PARAMETER);
-       return FALSE;
+       /* default to last position of menu */
+      SubMenu = MenuObject;
+      pos = MenuObject->MenuInfo.MenuItemCount;
    }