From 9f267c225893f665ffb0d8c8636166a2b42a4789 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 21 Jun 2022 13:52:55 +0200 Subject: [PATCH] win32u: Move GetMenuItemID implementation from user32. Signed-off-by: Jacek Caban --- 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 bee04f36dbf..eab97e58d39 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,