Commit 8723d345 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

server: Add fallback to desktop keystate in get_key_state wineserver call.

parent 6019da23
......@@ -2437,7 +2437,6 @@ static DWORD WINAPI get_key_state_thread(void *arg)
ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result);
result = GetKeyState('X');
todo_wine
ok((result & 0x8000) || broken(!(result & 0x8000)), /* > Win 2003 */
"expected that highest bit is set, got %x\n", result);
......
......@@ -2851,13 +2851,26 @@ DECL_HANDLER(get_key_state)
}
else
{
unsigned char *keystate;
if (!(thread = get_thread_from_id( req->tid ))) return;
if (thread->queue)
{
if (req->key >= 0) reply->state = thread->queue->input->keystate[req->key & 0xff];
set_reply_data( thread->queue->input->keystate, size );
release_object( thread );
return;
}
release_object( thread );
/* fallback to desktop keystate */
if (!(desktop = get_thread_desktop( current, 0 ))) return;
if (req->key >= 0) reply->state = desktop->keystate[req->key & 0xff] & ~0x40;
if ((keystate = set_reply_data_size( size )))
{
unsigned int i;
for (i = 0; i < size; i++) keystate[i] = desktop->keystate[i] & ~0x40;
}
release_object( desktop );
}
}
......
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