win32u: Move NtUserUnregisterHotKey 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:
Jacek Caban 2021-11-17 12:48:13 +01:00 committed by Alexandre Julliard
parent f65fa2f019
commit dc03ca3baf
8 changed files with 43 additions and 30 deletions

View File

@ -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.@)
*/

View File

@ -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)

View File

@ -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,
};

View File

@ -1176,6 +1176,7 @@ static struct unix_funcs unix_funcs =
NtUserIsClipboardFormatAvailable,
NtUserMapVirtualKeyEx,
NtUserToUnicodeEx,
NtUserUnregisterHotKey,
NtUserVkKeyScanEx,
GDIRealizePalette,

View File

@ -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;
}

View File

@ -1289,7 +1289,7 @@
@ stub NtUserUnloadKeyboardLayout
@ stub NtUserUnlockWindowStation
@ stub NtUserUnregisterClass
@ stub NtUserUnregisterHotKey
@ stdcall NtUserUnregisterHotKey(long long)
@ stub NtUserUnregisterSessionPort
@ stub NtUserUnregisterUserApiHook
@ stub NtUserUpdateDefaultDesktopThumbnail

View File

@ -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 */

View File

@ -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 );