From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/user32/menu.c | 12 ++---------- dlls/win32u/menu.c | 6 ++++++ include/ntuser.h | 1 + 3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 434353e8892..76144706771 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -537,17 +537,9 @@ INT WINAPI GetMenuItemCount( HMENU menu ) /********************************************************************** * GetMenuItemID (USER32.@) */ -UINT WINAPI GetMenuItemID( HMENU hMenu, INT nPos ) +UINT WINAPI GetMenuItemID( HMENU menu, INT pos ) { - POPUPMENU *menu; - UINT id, pos; - - if (!(menu = find_menu_item(hMenu, nPos, MF_BYPOSITION, &pos))) - return -1; - - id = menu->items[pos].fType & MF_POPUP ? -1 : menu->items[pos].wID; - release_menu_ptr(menu); - return id; + return NtUserThunkedMenuItemInfo( menu, pos, MF_BYPOSITION, NtUserGetMenuItemID, NULL, NULL ); }
diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index ca2c018f7e1..5bb76520d9b 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -1121,6 +1121,12 @@ UINT WINAPI NtUserThunkedMenuItemInfo( HMENU handle, UINT pos, UINT flags, UINT
switch (method) { + case NtUserGetMenuItemID: + if (!(menu = find_menu_item( handle, pos, flags, &i ))) return -1; + ret = menu->items[i].fType & MF_POPUP ? -1 : menu->items[i].wID; + release_menu_ptr( menu ); + break; + case NtUserGetMenuItemInfoA: return get_menu_item_info( handle, pos, flags, info, TRUE );
diff --git a/include/ntuser.h b/include/ntuser.h index d92332f13b9..41b328376a9 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -224,6 +224,7 @@ enum NtUserSetMenuItemInfo, NtUserInsertMenuItem, /* Wine extensions */ + NtUserGetMenuItemID, NtUserGetMenuItemInfoA, NtUserGetMenuItemInfoW, NtUserGetMenuState,