Commit 189da79a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserDeleteMenu implementation from user32.

parent dc0d16f1
...@@ -945,11 +945,11 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild ) ...@@ -945,11 +945,11 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild )
} }
/* close */ /* close */
DeleteMenu(menu, SC_CLOSE, MF_BYCOMMAND); NtUserDeleteMenu( menu, SC_CLOSE, MF_BYCOMMAND );
/* restore */ /* restore */
DeleteMenu(menu, SC_RESTORE, MF_BYCOMMAND); NtUserDeleteMenu( menu, SC_RESTORE, MF_BYCOMMAND );
/* minimize */ /* minimize */
DeleteMenu(menu, SC_MINIMIZE, MF_BYCOMMAND); NtUserDeleteMenu( menu, SC_MINIMIZE, MF_BYCOMMAND );
DrawMenuBar(frame); DrawMenuBar(frame);
......
...@@ -410,7 +410,7 @@ static HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) ...@@ -410,7 +410,7 @@ static HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu )
if (hPopupMenu) if (hPopupMenu)
{ {
if (GetClassLongW(hWnd, GCL_STYLE) & CS_NOCLOSE) if (GetClassLongW(hWnd, GCL_STYLE) & CS_NOCLOSE)
DeleteMenu(hPopupMenu, SC_CLOSE, MF_BYCOMMAND); NtUserDeleteMenu( hPopupMenu, SC_CLOSE, MF_BYCOMMAND );
InsertMenuW( hMenu, -1, MF_SYSMENU | MF_POPUP | MF_BYPOSITION, InsertMenuW( hMenu, -1, MF_SYSMENU | MF_POPUP | MF_BYPOSITION,
(UINT_PTR)hPopupMenu, NULL ); (UINT_PTR)hPopupMenu, NULL );
...@@ -3540,7 +3540,7 @@ BOOL WINAPI ChangeMenuA( HMENU hMenu, UINT pos, LPCSTR data, ...@@ -3540,7 +3540,7 @@ BOOL WINAPI ChangeMenuA( HMENU hMenu, UINT pos, LPCSTR data,
TRACE("menu=%p pos=%d data=%p id=%08x flags=%08x\n", hMenu, pos, data, id, flags ); TRACE("menu=%p pos=%d data=%p id=%08x flags=%08x\n", hMenu, pos, data, id, flags );
if (flags & MF_APPEND) return AppendMenuA( hMenu, flags & ~MF_APPEND, if (flags & MF_APPEND) return AppendMenuA( hMenu, flags & ~MF_APPEND,
id, data ); id, data );
if (flags & MF_DELETE) return DeleteMenu(hMenu, pos, flags & ~MF_DELETE); if (flags & MF_DELETE) return NtUserDeleteMenu( hMenu, pos, flags & ~MF_DELETE );
if (flags & MF_CHANGE) return ModifyMenuA(hMenu, pos, flags & ~MF_CHANGE, if (flags & MF_CHANGE) return ModifyMenuA(hMenu, pos, flags & ~MF_CHANGE,
id, data ); id, data );
if (flags & MF_REMOVE) return NtUserRemoveMenu( hMenu, if (flags & MF_REMOVE) return NtUserRemoveMenu( hMenu,
...@@ -3560,7 +3560,7 @@ BOOL WINAPI ChangeMenuW( HMENU hMenu, UINT pos, LPCWSTR data, ...@@ -3560,7 +3560,7 @@ BOOL WINAPI ChangeMenuW( HMENU hMenu, UINT pos, LPCWSTR data,
TRACE("menu=%p pos=%d data=%p id=%08x flags=%08x\n", hMenu, pos, data, id, flags ); TRACE("menu=%p pos=%d data=%p id=%08x flags=%08x\n", hMenu, pos, data, id, flags );
if (flags & MF_APPEND) return AppendMenuW( hMenu, flags & ~MF_APPEND, if (flags & MF_APPEND) return AppendMenuW( hMenu, flags & ~MF_APPEND,
id, data ); id, data );
if (flags & MF_DELETE) return DeleteMenu(hMenu, pos, flags & ~MF_DELETE); if (flags & MF_DELETE) return NtUserDeleteMenu( hMenu, pos, flags & ~MF_DELETE );
if (flags & MF_CHANGE) return ModifyMenuW(hMenu, pos, flags & ~MF_CHANGE, if (flags & MF_CHANGE) return ModifyMenuW(hMenu, pos, flags & ~MF_CHANGE,
id, data ); id, data );
if (flags & MF_REMOVE) return NtUserRemoveMenu( hMenu, if (flags & MF_REMOVE) return NtUserRemoveMenu( hMenu,
...@@ -3825,26 +3825,6 @@ BOOL WINAPI AppendMenuW( HMENU hMenu, UINT flags, ...@@ -3825,26 +3825,6 @@ BOOL WINAPI AppendMenuW( HMENU hMenu, UINT flags,
} }
/**********************************************************************
* DeleteMenu (USER32.@)
*/
BOOL WINAPI DeleteMenu( HMENU hMenu, UINT id, UINT flags )
{
POPUPMENU *menu;
UINT pos;
if (!(menu = find_menu_item(hMenu, id, flags, &pos)))
return FALSE;
if (menu->items[pos].fType & MF_POPUP)
NtUserDestroyMenu( menu->items[pos].hSubMenu );
NtUserRemoveMenu( menu->obj.handle, pos, flags | MF_BYPOSITION );
release_menu_ptr(menu);
return TRUE;
}
/******************************************************************* /*******************************************************************
* ModifyMenuW (USER32.@) * ModifyMenuW (USER32.@)
*/ */
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
@ stdcall DefWindowProcA(long long long long) @ stdcall DefWindowProcA(long long long long)
@ stdcall DefWindowProcW(long long long long) @ stdcall DefWindowProcW(long long long long)
@ stdcall DeferWindowPos(long long long long long long long long) @ stdcall DeferWindowPos(long long long long long long long long)
@ stdcall DeleteMenu(long long long) @ stdcall DeleteMenu(long long long) NtUserDeleteMenu
@ stdcall DeregisterShellHookWindow (long) @ stdcall DeregisterShellHookWindow (long)
@ stdcall DestroyAcceleratorTable(long) NtUserDestroyAcceleratorTable @ stdcall DestroyAcceleratorTable(long) NtUserDestroyAcceleratorTable
@ stdcall DestroyCaret() @ stdcall DestroyCaret()
......
...@@ -977,6 +977,25 @@ BOOL WINAPI NtUserRemoveMenu( HMENU handle, UINT id, UINT flags ) ...@@ -977,6 +977,25 @@ BOOL WINAPI NtUserRemoveMenu( HMENU handle, UINT id, UINT flags )
} }
/********************************************************************** /**********************************************************************
* NtUserDeleteMenu (win32u.@)
*/
BOOL WINAPI NtUserDeleteMenu( HMENU handle, UINT id, UINT flags )
{
POPUPMENU *menu;
UINT pos;
if (!(menu = find_menu_item( handle, id, flags, &pos )))
return FALSE;
if (menu->items[pos].fType & MF_POPUP)
NtUserDestroyMenu( menu->items[pos].hSubMenu );
NtUserRemoveMenu( menu->obj.handle, pos, flags | MF_BYPOSITION );
release_menu_ptr( menu );
return TRUE;
}
/**********************************************************************
* NtUserSetMenuContextHelpId (win32u.@) * NtUserSetMenuContextHelpId (win32u.@)
*/ */
BOOL WINAPI NtUserSetMenuContextHelpId( HMENU handle, DWORD id ) BOOL WINAPI NtUserSetMenuContextHelpId( HMENU handle, DWORD id )
......
...@@ -114,6 +114,7 @@ static void * const syscalls[] = ...@@ -114,6 +114,7 @@ static void * const syscalls[] =
NtUserCreateAcceleratorTable, NtUserCreateAcceleratorTable,
NtUserCreateDesktopEx, NtUserCreateDesktopEx,
NtUserCreateWindowStation, NtUserCreateWindowStation,
NtUserDeleteMenu,
NtUserDestroyAcceleratorTable, NtUserDestroyAcceleratorTable,
NtUserFindExistingCursorIcon, NtUserFindExistingCursorIcon,
NtUserFindWindowEx, NtUserFindWindowEx,
......
...@@ -824,7 +824,7 @@ ...@@ -824,7 +824,7 @@
@ stdcall NtUserDeferWindowPosAndBand(long long long long long long long long long long) @ stdcall NtUserDeferWindowPosAndBand(long long long long long long long long long long)
@ stub NtUserDelegateCapturePointers @ stub NtUserDelegateCapturePointers
@ stub NtUserDelegateInput @ stub NtUserDelegateInput
@ stub NtUserDeleteMenu @ stdcall -syscall NtUserDeleteMenu(long long long)
@ stub NtUserDeleteWindowGroup @ stub NtUserDeleteWindowGroup
@ stdcall -syscall NtUserDestroyAcceleratorTable(long) @ stdcall -syscall NtUserDestroyAcceleratorTable(long)
@ stub NtUserDestroyActivationGroup @ stub NtUserDestroyActivationGroup
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
SYSCALL_ENTRY( NtUserCreateAcceleratorTable ) \ SYSCALL_ENTRY( NtUserCreateAcceleratorTable ) \
SYSCALL_ENTRY( NtUserCreateDesktopEx ) \ SYSCALL_ENTRY( NtUserCreateDesktopEx ) \
SYSCALL_ENTRY( NtUserCreateWindowStation ) \ SYSCALL_ENTRY( NtUserCreateWindowStation ) \
SYSCALL_ENTRY( NtUserDeleteMenu ) \
SYSCALL_ENTRY( NtUserDestroyAcceleratorTable ) \ SYSCALL_ENTRY( NtUserDestroyAcceleratorTable ) \
SYSCALL_ENTRY( NtUserFindExistingCursorIcon ) \ SYSCALL_ENTRY( NtUserFindExistingCursorIcon ) \
SYSCALL_ENTRY( NtUserFindWindowEx ) \ SYSCALL_ENTRY( NtUserFindWindowEx ) \
......
...@@ -669,6 +669,15 @@ NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args ) ...@@ -669,6 +669,15 @@ NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args )
return NtUserCheckMenuItem( handle, id, flags ); return NtUserCheckMenuItem( handle, id, flags );
} }
NTSTATUS WINAPI wow64_NtUserDeleteMenu( UINT *args )
{
HMENU menu = get_handle( &args );
UINT id = get_ulong( &args );
UINT flags = get_ulong( &args );
return NtUserDeleteMenu( menu, id, flags );
}
NTSTATUS WINAPI wow64_NtUserGetMenuItemRect( UINT *args ) NTSTATUS WINAPI wow64_NtUserGetMenuItemRect( UINT *args )
{ {
HWND hwnd = get_handle( &args ); HWND hwnd = get_handle( &args );
......
...@@ -487,6 +487,7 @@ HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK m ...@@ -487,6 +487,7 @@ HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK m
ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 ); ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 );
HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, INT x, INT y, HDWP WINAPI NtUserDeferWindowPosAndBand( HDWP hdwp, HWND hwnd, HWND after, INT x, INT y,
INT cx, INT cy, UINT flags, UINT unk1, UINT unk2 ); INT cx, INT cy, UINT flags, UINT unk1, UINT unk2 );
BOOL WINAPI NtUserDeleteMenu( HMENU menu, UINT id, UINT flags );
BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle ); BOOL WINAPI NtUserDestroyAcceleratorTable( HACCEL handle );
BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg ); BOOL WINAPI NtUserDestroyCursor( HCURSOR cursor, ULONG arg );
BOOL WINAPI NtUserDestroyMenu( HMENU menu ); BOOL WINAPI NtUserDestroyMenu( HMENU menu );
......
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