mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 16:14:10 +00:00
win32u: Move NtUserThunkedMenuInfo implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4b865129a5
commit
99b94fcc74
|
@ -5073,54 +5073,18 @@ BOOL WINAPI CheckMenuRadioItem(HMENU hMenu, UINT first, UINT last,
|
|||
|
||||
/**********************************************************************
|
||||
* SetMenuInfo (USER32.@)
|
||||
*
|
||||
* FIXME
|
||||
* actually use the items to draw the menu
|
||||
* (recalculate and/or redraw)
|
||||
*/
|
||||
static BOOL menu_SetMenuInfo( HMENU hMenu, LPCMENUINFO lpmi)
|
||||
BOOL WINAPI SetMenuInfo( HMENU menu, const MENUINFO *info )
|
||||
{
|
||||
POPUPMENU *menu;
|
||||
if( !(menu = MENU_GetMenu(hMenu))) return FALSE;
|
||||
TRACE( "(%p %p)\n", menu, info );
|
||||
|
||||
if (lpmi->fMask & MIM_BACKGROUND)
|
||||
menu->hbrBack = lpmi->hbrBack;
|
||||
|
||||
if (lpmi->fMask & MIM_HELPID)
|
||||
menu->dwContextHelpID = lpmi->dwContextHelpID;
|
||||
|
||||
if (lpmi->fMask & MIM_MAXHEIGHT)
|
||||
menu->cyMax = lpmi->cyMax;
|
||||
|
||||
if (lpmi->fMask & MIM_MENUDATA)
|
||||
menu->dwMenuData = lpmi->dwMenuData;
|
||||
|
||||
if (lpmi->fMask & MIM_STYLE)
|
||||
menu->dwStyle = lpmi->dwStyle;
|
||||
|
||||
if( lpmi->fMask & MIM_APPLYTOSUBMENUS) {
|
||||
int i;
|
||||
MENUITEM *item = menu->items;
|
||||
for( i = menu->nItems; i; i--, item++)
|
||||
if( item->fType & MF_POPUP)
|
||||
menu_SetMenuInfo( item->hSubMenu, lpmi);
|
||||
if (!info || info->cbSize != sizeof(*info))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI SetMenuInfo (HMENU hMenu, LPCMENUINFO lpmi)
|
||||
{
|
||||
TRACE("(%p %p)\n", hMenu, lpmi);
|
||||
if( lpmi && (lpmi->cbSize == sizeof( MENUINFO)) && (menu_SetMenuInfo( hMenu, lpmi))) {
|
||||
if( lpmi->fMask & MIM_STYLE) {
|
||||
if (lpmi->dwStyle & MNS_AUTODISMISS) FIXME("MNS_AUTODISMISS unimplemented\n");
|
||||
if (lpmi->dwStyle & MNS_DRAGDROP) FIXME("MNS_DRAGDROP unimplemented\n");
|
||||
if (lpmi->dwStyle & MNS_MODELESS) FIXME("MNS_MODELESS unimplemented\n");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
SetLastError( ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
return NtUserThunkedMenuInfo( menu, info );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -451,6 +451,59 @@ BOOL WINAPI NtUserGetMenuItemRect( HWND hwnd, HMENU handle, UINT item, RECT *rec
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL set_menu_info( HMENU handle, const MENUINFO *info )
|
||||
{
|
||||
POPUPMENU *menu;
|
||||
|
||||
if (!(menu = grab_menu_ptr( handle ))) return FALSE;
|
||||
|
||||
if (info->fMask & MIM_BACKGROUND) menu->hbrBack = info->hbrBack;
|
||||
if (info->fMask & MIM_HELPID) menu->dwContextHelpID = info->dwContextHelpID;
|
||||
if (info->fMask & MIM_MAXHEIGHT) menu->cyMax = info->cyMax;
|
||||
if (info->fMask & MIM_MENUDATA) menu->dwMenuData = info->dwMenuData;
|
||||
if (info->fMask & MIM_STYLE) menu->dwStyle = info->dwStyle;
|
||||
|
||||
if (info->fMask & MIM_APPLYTOSUBMENUS)
|
||||
{
|
||||
int i;
|
||||
MENUITEM *item = menu->items;
|
||||
for (i = menu->nItems; i; i--, item++)
|
||||
if (item->fType & MF_POPUP)
|
||||
set_menu_info( item->hSubMenu, info);
|
||||
}
|
||||
|
||||
release_menu_ptr( menu );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* NtUserThunkedMenuInfo (win32u.@)
|
||||
*/
|
||||
BOOL WINAPI NtUserThunkedMenuInfo( HMENU menu, const MENUINFO *info )
|
||||
{
|
||||
TRACE( "(%p %p)\n", menu, info );
|
||||
|
||||
if (!info)
|
||||
{
|
||||
SetLastError( ERROR_NOACCESS );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!set_menu_info( menu, info ))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_MENU_HANDLE );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (info->fMask & MIM_STYLE)
|
||||
{
|
||||
if (info->dwStyle & MNS_AUTODISMISS) FIXME("MNS_AUTODISMISS unimplemented\n");
|
||||
if (info->dwStyle & MNS_DRAGDROP) FIXME("MNS_DRAGDROP unimplemented\n");
|
||||
if (info->dwStyle & MNS_MODELESS) FIXME("MNS_MODELESS unimplemented\n");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* see GetMenuInfo */
|
||||
BOOL get_menu_info( HMENU handle, MENUINFO *info )
|
||||
{
|
||||
|
|
|
@ -166,6 +166,7 @@ static void * const syscalls[] =
|
|||
NtUserSetTimer,
|
||||
NtUserSetWinEventHook,
|
||||
NtUserSetWindowsHookEx,
|
||||
NtUserThunkedMenuInfo,
|
||||
NtUserUnhookWinEvent,
|
||||
NtUserUnhookWindowsHookEx,
|
||||
NtUserWindowFromDC,
|
||||
|
|
|
@ -1274,7 +1274,7 @@
|
|||
@ stdcall NtUserSystemParametersInfo(long long ptr long)
|
||||
@ stdcall NtUserSystemParametersInfoForDpi(long long ptr long long)
|
||||
@ stub NtUserTestForInteractiveUser
|
||||
@ stub NtUserThunkedMenuInfo
|
||||
@ stdcall -syscall NtUserThunkedMenuInfo(long ptr)
|
||||
@ stub NtUserThunkedMenuItemInfo
|
||||
@ stdcall NtUserToUnicodeEx(long long ptr ptr long long long)
|
||||
@ stub NtUserTrackMouseEvent
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
SYSCALL_ENTRY( NtUserSetTimer ) \
|
||||
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
|
||||
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
|
||||
SYSCALL_ENTRY( NtUserThunkedMenuInfo ) \
|
||||
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
|
||||
SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) \
|
||||
SYSCALL_ENTRY( NtUserWindowFromDC )
|
||||
|
|
|
@ -658,3 +658,32 @@ NTSTATUS WINAPI wow64_NtUserSetMenuContextHelpId( UINT *args )
|
|||
|
||||
return NtUserSetMenuContextHelpId( menu, id );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI wow64_NtUserThunkedMenuInfo( UINT *args )
|
||||
{
|
||||
HMENU menu = get_handle( &args );
|
||||
const struct
|
||||
{
|
||||
DWORD cbSize;
|
||||
DWORD fMask;
|
||||
DWORD dwStyle;
|
||||
UINT cyMax;
|
||||
ULONG hbrBack;
|
||||
DWORD dwContextHelpID;
|
||||
ULONG dwMenuData;
|
||||
} *info32 = get_ptr( &args );
|
||||
MENUINFO info;
|
||||
|
||||
if (info32)
|
||||
{
|
||||
info.cbSize = sizeof(info);
|
||||
info.fMask = info32->fMask;
|
||||
info.dwStyle = info32->dwStyle;
|
||||
info.cyMax = info32->cyMax;
|
||||
info.hbrBack = UlongToHandle( info32->hbrBack );
|
||||
info.dwContextHelpID = info32->dwContextHelpID;
|
||||
info.dwMenuData = info32->dwMenuData;
|
||||
}
|
||||
|
||||
return NtUserThunkedMenuInfo( menu, info32 ? &info : NULL );
|
||||
}
|
||||
|
|
|
@ -580,6 +580,7 @@ BOOL WINAPI NtUserShowWindow( HWND hwnd, INT cmd );
|
|||
BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd );
|
||||
BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT winini );
|
||||
BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, UINT winini, UINT dpi );
|
||||
BOOL WINAPI NtUserThunkedMenuInfo( HMENU menu, const MENUINFO *info );
|
||||
INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
|
||||
WCHAR *str, int size, UINT flags, HKL layout );
|
||||
INT WINAPI NtUserTranslateAccelerator( HWND hwnd, HACCEL accel, MSG *msg );
|
||||
|
|
Loading…
Reference in a new issue