Commit bad82953 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move GetMenuItemCount implementation from user32.

parent 1899cd2a
......@@ -3696,17 +3696,9 @@ UINT WINAPI GetMenuState( HMENU menu, UINT item, UINT flags )
/**********************************************************************
* GetMenuItemCount (USER32.@)
*/
INT WINAPI GetMenuItemCount( HMENU hMenu )
INT WINAPI GetMenuItemCount( HMENU menu )
{
POPUPMENU *menu = grab_menu_ptr(hMenu);
INT count;
if (!menu) return -1;
count = menu->nItems;
release_menu_ptr(menu);
TRACE("(%p) returning %d\n", hMenu, count);
return count;
return NtUserGetMenuItemCount( menu );
}
......
......@@ -864,6 +864,20 @@ UINT WINAPI NtUserThunkedMenuItemInfo( HMENU handle, UINT pos, UINT flags, UINT
return ret;
}
/* see GetMenuItemCount */
INT get_menu_item_count( HMENU handle )
{
POPUPMENU *menu;
INT count;
if (!(menu = grab_menu_ptr( handle ))) return -1;
count = menu->nItems;
release_menu_ptr(menu);
TRACE( "(%p) returning %d\n", handle, count );
return count;
}
/**********************************************************************
* NtUserRemoveMenu (win32u.@)
*/
......
......@@ -4718,6 +4718,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
case NtUserCallOneParam_GetIconParam:
return get_icon_param( UlongToHandle(arg) );
case NtUserCallOneParam_GetMenuItemCount:
return get_menu_item_count( UlongToHandle(arg) );
case NtUserCallOneParam_GetSysColor:
return get_sys_color( arg );
......
......@@ -377,6 +377,7 @@ extern HMENU create_menu( BOOL is_popup ) DECLSPEC_HIDDEN;
extern BOOL draw_menu_bar( HWND hwnd ) DECLSPEC_HIDDEN;
extern HMENU get_menu( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL get_menu_info( HMENU handle, MENUINFO *info ) DECLSPEC_HIDDEN;
extern INT get_menu_item_count( HMENU handle ) DECLSPEC_HIDDEN;
extern BOOL set_window_menu( HWND hwnd, HMENU handle ) DECLSPEC_HIDDEN;
/* message.c */
......
......@@ -704,6 +704,7 @@ enum
NtUserCallOneParam_GetClipCursor,
NtUserCallOneParam_GetCursorPos,
NtUserCallOneParam_GetIconParam,
NtUserCallOneParam_GetMenuItemCount,
NtUserCallOneParam_GetPrimaryMonitorRect,
NtUserCallOneParam_GetSysColor,
NtUserCallOneParam_GetSysColorBrush,
......@@ -773,6 +774,11 @@ static inline UINT_PTR NtUserGetIconParam( HICON icon )
return NtUserCallOneParam( HandleToUlong(icon), NtUserCallOneParam_GetIconParam );
}
static inline UINT_PTR NtUserGetMenuItemCount( HMENU menu )
{
return NtUserCallOneParam( HandleToUlong(menu), NtUserCallOneParam_GetMenuItemCount );
}
static inline RECT NtUserGetPrimaryMonitorRect(void)
{
RECT primary;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment