diff --git a/dlls/user32/input.c b/dlls/user32/input.c index c62ac755bb8..3de25f4218a 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -919,34 +919,6 @@ BOOL WINAPI RegisterHotKey(HWND hwnd,INT id,UINT modifiers,UINT vk) return ret; } -/*********************************************************************** - * UnregisterHotKey (USER32.@) - */ -BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id) -{ - BOOL ret; - UINT modifiers, vk; - - TRACE_(keyboard)("(%p,%d)\n",hwnd,id); - - SERVER_START_REQ( unregister_hotkey ) - { - req->window = wine_server_user_handle( hwnd ); - req->id = id; - if ((ret = !wine_server_call_err( req ))) - { - modifiers = reply->flags; - vk = reply->vkey; - } - } - SERVER_END_REQ; - - if (ret) - USER_Driver->pUnregisterHotKey(hwnd, modifiers, vk); - - return ret; -} - /*********************************************************************** * LoadKeyboardLayoutW (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 6aa71f814b6..2b022d931aa 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -780,7 +780,7 @@ @ stdcall UnregisterClassA(str long) @ stdcall UnregisterClassW(wstr long) @ stdcall UnregisterDeviceNotification(long) -@ stdcall UnregisterHotKey(long long) +@ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey # @ stub UnregisterMessagePumpHook @ stdcall UnregisterPowerSettingNotification(ptr) @ stdcall UnregisterTouchWindow(long) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index ad2f4887198..f8cce32b5f3 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -1029,6 +1029,11 @@ static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout ); } +static void CDECL loaderdrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk ) +{ + load_driver()->pUnregisterHotKey( hwnd, modifiers, vk ); +} + static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout ) { return load_driver()->pVkKeyScanEx( ch, layout ); @@ -1046,6 +1051,7 @@ static const struct user_driver_funcs lazy_load_driver = .pGetKeyboardLayoutList = loaderdrv_GetKeyboardLayoutList, .pMapVirtualKeyEx = loaderdrv_MapVirtualKeyEx, .pToUnicodeEx = loaderdrv_ToUnicodeEx, + .pUnregisterHotKey = loaderdrv_UnregisterHotKey, .pVkKeyScanEx = loaderdrv_VkKeyScanEx, .pUpdateClipboard = loaderdrv_UpdateClipboard, }; diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 0303e5acd42..39186cc94a7 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1176,6 +1176,7 @@ static struct unix_funcs unix_funcs = NtUserIsClipboardFormatAvailable, NtUserMapVirtualKeyEx, NtUserToUnicodeEx, + NtUserUnregisterHotKey, NtUserVkKeyScanEx, GDIRealizePalette, diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index a1249b505f6..e1c8595ac07 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -670,3 +670,31 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts ) return count; } + +/*********************************************************************** + * NtUserUnregisterHotKey (win32u.@) + */ +BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id ) +{ + BOOL ret; + UINT modifiers, vk; + + TRACE_(keyboard)("(%p,%d)\n",hwnd,id); + + SERVER_START_REQ( unregister_hotkey ) + { + req->window = wine_server_user_handle( hwnd ); + req->id = id; + if ((ret = !wine_server_call_err( req ))) + { + modifiers = reply->flags; + vk = reply->vkey; + } + } + SERVER_END_REQ; + + if (ret) + user_driver->pUnregisterHotKey(hwnd, modifiers, vk); + + return ret; +} diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 99b09b23201..47e352c2f27 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1289,7 +1289,7 @@ @ stub NtUserUnloadKeyboardLayout @ stub NtUserUnlockWindowStation @ stub NtUserUnregisterClass -@ stub NtUserUnregisterHotKey +@ stdcall NtUserUnregisterHotKey(long long) @ stub NtUserUnregisterSessionPort @ stub NtUserUnregisterUserApiHook @ stub NtUserUpdateDefaultDesktopThumbnail diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 13b75b91a7c..ecc9833a037 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -204,6 +204,7 @@ struct unix_funcs UINT (WINAPI *pNtUserMapVirtualKeyEx)( UINT code, UINT type, HKL layout ); INT (WINAPI *pNtUserToUnicodeEx)( UINT virt, UINT scan, const BYTE *state, WCHAR *str, int size, UINT flags, HKL layout ); + BOOL (WINAPI *pNtUserUnregisterHotKey)( HWND hwnd, INT id ); WORD (WINAPI *pNtUserVkKeyScanEx)( WCHAR chr, HKL layout ); /* Wine-specific functions */ diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 1f5bef4e4b8..63866ac451c 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -642,6 +642,11 @@ INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state, return unix_funcs->pNtUserToUnicodeEx( virt, scan, state, str, size, flags, layout ); } +BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id ) +{ + return unix_funcs->pNtUserUnregisterHotKey( hwnd, id ); +} + WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ) { return unix_funcs->pNtUserVkKeyScanEx( chr, layout );