Commit 77ab5101 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move menu item info management from user32.

parent 75c297f2
......@@ -120,7 +120,6 @@ extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt ) DECLSPEC_HIDDE
extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, WCHAR wChar ) DECLSPEC_HIDDEN;
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd ) DECLSPEC_HIDDEN;
extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
extern void free_menu_items( void *ptr ) DECLSPEC_HIDDEN;
/* nonclient area */
extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
......
......@@ -417,7 +417,7 @@ static LRESULT MDI_RefreshMenu(MDICLIENTINFO *ci)
if (mii.wID == ci->idFirstChild)
{
TRACE("removing %u items including separator\n", count - i);
while (RemoveMenu(ci->hWindowMenu, i, MF_BYPOSITION))
while (NtUserRemoveMenu( ci->hWindowMenu, i, MF_BYPOSITION ))
/* nothing */;
break;
......@@ -935,7 +935,7 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild )
TRUE,
&menuInfo);
RemoveMenu(menu,0,MF_BYPOSITION);
NtUserRemoveMenu( menu, 0, MF_BYPOSITION );
if ( (menuInfo.fType & MFT_BITMAP) &&
(LOWORD(menuInfo.dwTypeData)!=0) &&
......
......@@ -619,7 +619,7 @@
@ stdcall ReleaseCapture()
@ stdcall ReleaseDC(long long) NtUserReleaseDC
@ stdcall RemoveClipboardFormatListener(long) NtUserRemoveClipboardFormatListener
@ stdcall RemoveMenu(long long long)
@ stdcall RemoveMenu(long long long) NtUserRemoveMenu
@ stdcall RemovePropA(long str)
@ stdcall RemovePropW(long wstr)
@ stdcall ReplyMessage(long)
......
......@@ -165,7 +165,6 @@ static const struct user_callbacks user_funcs =
ImmProcessKey,
ImmTranslateMessage,
SetSystemMenu,
free_menu_items,
free_win_ptr,
MENU_IsMenuActive,
notify_ime,
......
......@@ -38,7 +38,6 @@ struct user_callbacks
BOOL (WINAPI *pImmProcessKey)(HWND, HKL, UINT, LPARAM, DWORD);
BOOL (WINAPI *pImmTranslateMessage)(HWND, UINT, WPARAM, LPARAM);
BOOL (WINAPI *pSetSystemMenu)( HWND hwnd, HMENU menu );
void (CDECL *free_menu_items)( void *ptr );
void (CDECL *free_win_ptr)( struct tagWND *win );
HWND (CDECL *is_menu_active)(void);
void (CDECL *notify_ime)( HWND hwnd, UINT param );
......
......@@ -156,6 +156,7 @@ static void * const syscalls[] =
NtUserOpenInputDesktop,
NtUserOpenWindowStation,
NtUserRemoveClipboardFormatListener,
NtUserRemoveMenu,
NtUserRemoveProp,
NtUserSetKeyboardState,
NtUserSetMenuContextHelpId,
......@@ -170,6 +171,7 @@ static void * const syscalls[] =
NtUserSetWinEventHook,
NtUserSetWindowsHookEx,
NtUserThunkedMenuInfo,
NtUserThunkedMenuItemInfo,
NtUserUnhookWinEvent,
NtUserUnhookWindowsHookEx,
NtUserWindowFromDC,
......
......@@ -1147,7 +1147,7 @@
@ stub NtUserRemoteStopScreenUpdates
@ stdcall -syscall NtUserRemoveClipboardFormatListener(long)
@ stub NtUserRemoveInjectionDevice
@ stub NtUserRemoveMenu
@ stdcall -syscall NtUserRemoveMenu(long long long)
@ stdcall -syscall NtUserRemoveProp(long wstr)
@ stub NtUserRemoveVisualIdentifier
@ stub NtUserReportInertia
......@@ -1275,7 +1275,7 @@
@ stdcall NtUserSystemParametersInfoForDpi(long long ptr long long)
@ stub NtUserTestForInteractiveUser
@ stdcall -syscall NtUserThunkedMenuInfo(long ptr)
@ stub NtUserThunkedMenuItemInfo
@ stdcall -syscall NtUserThunkedMenuItemInfo(long long long long ptr ptr)
@ stdcall NtUserToUnicodeEx(long long ptr ptr long long long)
@ stdcall NtUserTrackMouseEvent(ptr)
@ stub NtUserTrackPopupMenuEx
......
......@@ -143,6 +143,7 @@
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \
SYSCALL_ENTRY( NtUserRemoveMenu ) \
SYSCALL_ENTRY( NtUserRemoveProp ) \
SYSCALL_ENTRY( NtUserSetKeyboardState ) \
SYSCALL_ENTRY( NtUserSetMenuContextHelpId ) \
......@@ -157,6 +158,7 @@
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
SYSCALL_ENTRY( NtUserThunkedMenuInfo ) \
SYSCALL_ENTRY( NtUserThunkedMenuItemInfo ) \
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) \
SYSCALL_ENTRY( NtUserWindowFromDC )
......
......@@ -30,6 +30,22 @@
WINE_DEFAULT_DEBUG_CHANNEL(wow);
typedef struct
{
UINT cbSize;
UINT fMask;
UINT fType;
UINT fState;
UINT wID;
UINT32 hSubMenu;
UINT32 hbmpChecked;
UINT32 hbmpUnchecked;
UINT32 dwItemData;
UINT32 dwTypeData;
UINT cch;
UINT32 hbmpItem;
} MENUITEMINFOW32;
NTSTATUS WINAPI wow64_NtUserInitializeClientPfnArrays( UINT *args )
{
FIXME( "\n" );
......@@ -708,3 +724,50 @@ NTSTATUS WINAPI wow64_NtUserThunkedMenuInfo( UINT *args )
return NtUserThunkedMenuInfo( menu, info32 ? &info : NULL );
}
NTSTATUS WINAPI wow64_NtUserThunkedMenuItemInfo( UINT *args )
{
HMENU handle = get_handle( &args );
UINT pos = get_ulong( &args );
UINT flags = get_ulong( &args );
UINT method = get_ulong( &args );
MENUITEMINFOW32 *info32 = get_ptr( &args );
UNICODE_STRING32 *str32 = get_ptr( &args );
MENUITEMINFOW info = { sizeof(info) }, *info_ptr;
UNICODE_STRING str;
if (info32)
{
info.cbSize = sizeof(info);
info.fMask = info32->fMask;
switch (method)
{
case NtUserSetMenuItemInfo:
case NtUserInsertMenuItem:
info.fType = info32->fType;
info.fState = info32->fState;
info.wID = info32->wID;
info.hSubMenu = UlongToHandle( info32->hSubMenu );
info.hbmpChecked = UlongToHandle( info32->hbmpUnchecked );
info.dwItemData = info32->dwItemData;
info.dwTypeData = UlongToPtr( info32->dwTypeData );
info.cch = info32->cch;
info.hbmpItem = UlongToHandle( info32->hbmpItem );
break;
}
info_ptr = &info;
}
else info_ptr = NULL;
return NtUserThunkedMenuItemInfo( handle, pos, flags, method, info_ptr,
unicode_str_32to64( &str, str32 ));
}
NTSTATUS WINAPI wow64_NtUserRemoveMenu( UINT *args )
{
HMENU handle = get_handle( &args );
UINT id = get_ulong( &args );
UINT flags = get_ulong( &args );
return NtUserRemoveMenu( handle, id, flags );
}
......@@ -178,6 +178,13 @@ enum
NtUserSpyExit = 0x0301,
};
/* NtUserThunkedMenuItemInfo codes */
enum
{
NtUserSetMenuItemInfo,
NtUserInsertMenuItem,
};
struct send_message_timeout_params
{
UINT flags;
......@@ -581,6 +588,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *
BOOL WINAPI NtUserRegisterHotKey( HWND hwnd, INT id, UINT modifiers, UINT vk );
INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc );
BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd );
BOOL WINAPI NtUserRemoveMenu( HMENU menu, UINT id, UINT flags );
HANDLE WINAPI NtUserRemoveProp( HWND hwnd, const WCHAR *str );
BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
HRGN ret_update_rgn, RECT *update_rect );
......@@ -629,6 +637,8 @@ 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 );
UINT WINAPI NtUserThunkedMenuItemInfo( HMENU menu, UINT pos, UINT flags, UINT method,
MENUITEMINFOW *info, UNICODE_STRING *str );
INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state,
WCHAR *str, int size, UINT flags, HKL layout );
BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info );
......
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