user32: Remove unused GetAsyncKeyState() driver entry.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Huw Davies 2019-11-06 10:06:23 +00:00 committed by Alexandre Julliard
parent f4d6df8947
commit ae7531f673
3 changed files with 32 additions and 50 deletions

View File

@ -106,7 +106,6 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(ActivateKeyboardLayout); GET_USER_FUNC(ActivateKeyboardLayout);
GET_USER_FUNC(Beep); GET_USER_FUNC(Beep);
GET_USER_FUNC(GetAsyncKeyState);
GET_USER_FUNC(GetKeyNameText); GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(GetKeyboardLayout); GET_USER_FUNC(GetKeyboardLayout);
GET_USER_FUNC(GetKeyboardLayoutList); GET_USER_FUNC(GetKeyboardLayoutList);
@ -206,11 +205,6 @@ static void CDECL nulldrv_Beep(void)
{ {
} }
static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
{
return -1;
}
static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts ) static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
{ {
HKEY hKeyKeyboard; HKEY hKeyKeyboard;
@ -494,7 +488,6 @@ static USER_DRIVER null_driver =
/* keyboard functions */ /* keyboard functions */
nulldrv_ActivateKeyboardLayout, nulldrv_ActivateKeyboardLayout,
nulldrv_Beep, nulldrv_Beep,
nulldrv_GetAsyncKeyState,
nulldrv_GetKeyNameText, nulldrv_GetKeyNameText,
nulldrv_GetKeyboardLayout, nulldrv_GetKeyboardLayout,
nulldrv_GetKeyboardLayoutList, nulldrv_GetKeyboardLayoutList,
@ -566,11 +559,6 @@ static void CDECL loaderdrv_Beep(void)
load_driver()->pBeep(); load_driver()->pBeep();
} }
static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
{
return load_driver()->pGetAsyncKeyState( key );
}
static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
{ {
return load_driver()->pGetKeyNameText( lparam, buffer, size ); return load_driver()->pGetKeyNameText( lparam, buffer, size );
@ -715,7 +703,6 @@ static USER_DRIVER lazy_load_driver =
/* keyboard functions */ /* keyboard functions */
loaderdrv_ActivateKeyboardLayout, loaderdrv_ActivateKeyboardLayout,
loaderdrv_Beep, loaderdrv_Beep,
loaderdrv_GetAsyncKeyState,
loaderdrv_GetKeyNameText, loaderdrv_GetKeyNameText,
loaderdrv_GetKeyboardLayout, loaderdrv_GetKeyboardLayout,
loaderdrv_GetKeyboardLayoutList, loaderdrv_GetKeyboardLayoutList,

View File

@ -401,51 +401,47 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
check_for_events( QS_INPUT ); check_for_events( QS_INPUT );
if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1) if (key_state_info && !(key_state_info->state[key] & 0xc0) &&
key_state_info->counter == counter && GetTickCount() - key_state_info->time < 50)
{ {
if (key_state_info && /* use cached value */
!(key_state_info->state[key] & 0xc0) && return 0;
key_state_info->counter == counter && }
GetTickCount() - key_state_info->time < 50) else if (!key_state_info)
{ {
/* use cached value */ key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) );
return 0; get_user_thread_info()->key_state = key_state_info;
} }
else if (!key_state_info)
{
key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) );
get_user_thread_info()->key_state = key_state_info;
}
ret = 0; ret = 0;
SERVER_START_REQ( get_key_state ) SERVER_START_REQ( get_key_state )
{
req->tid = 0;
req->key = key;
if (key_state_info)
{ {
req->tid = 0; prev_key_state = key_state_info->state[key];
req->key = key; wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) );
}
if (!wine_server_call( req ))
{
if (reply->state & 0x40) ret |= 0x0001;
if (reply->state & 0x80) ret |= 0x8000;
if (key_state_info) if (key_state_info)
{ {
prev_key_state = key_state_info->state[key]; /* force refreshing the key state cache - some multithreaded programs
wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) ); * (like Adobe Photoshop CS5) expect that changes to the async key state
} * are also immediately available in other threads. */
if (!wine_server_call( req )) if (prev_key_state != key_state_info->state[key])
{ counter = interlocked_xchg_add( &global_key_state_counter, 1 ) + 1;
if (reply->state & 0x40) ret |= 0x0001;
if (reply->state & 0x80) ret |= 0x8000;
if (key_state_info)
{
/* force refreshing the key state cache - some multithreaded programs
* (like Adobe Photoshop CS5) expect that changes to the async key state
* are also immediately available in other threads. */
if (prev_key_state != key_state_info->state[key])
counter = interlocked_xchg_add( &global_key_state_counter, 1 ) + 1;
key_state_info->time = GetTickCount(); key_state_info->time = GetTickCount();
key_state_info->counter = counter; key_state_info->counter = counter;
}
} }
} }
SERVER_END_REQ;
} }
SERVER_END_REQ;
return ret; return ret;
} }

View File

@ -64,7 +64,6 @@ typedef struct tagUSER_DRIVER {
/* keyboard functions */ /* keyboard functions */
HKL (CDECL *pActivateKeyboardLayout)(HKL, UINT); HKL (CDECL *pActivateKeyboardLayout)(HKL, UINT);
void (CDECL *pBeep)(void); void (CDECL *pBeep)(void);
SHORT (CDECL *pGetAsyncKeyState)(INT);
INT (CDECL *pGetKeyNameText)(LONG, LPWSTR, INT); INT (CDECL *pGetKeyNameText)(LONG, LPWSTR, INT);
HKL (CDECL *pGetKeyboardLayout)(DWORD); HKL (CDECL *pGetKeyboardLayout)(DWORD);
UINT (CDECL *pGetKeyboardLayoutList)(INT, HKL *); UINT (CDECL *pGetKeyboardLayoutList)(INT, HKL *);