server: Remove tid from set_key_state request.

As it is always set to GetCurrentThreadId().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-04-02 10:08:00 +02:00 committed by Alexandre Julliard
parent 626870abe2
commit 6444e4fade
7 changed files with 8 additions and 27 deletions

View File

@ -591,7 +591,6 @@ BOOL WINAPI SetKeyboardState( LPBYTE state )
SERVER_START_REQ( set_key_state )
{
req->tid = GetCurrentThreadId();
wine_server_add_data( req, state, 256 );
ret = !wine_server_call_err( req );
}

View File

@ -1177,7 +1177,6 @@ static void set_async_key_state( const BYTE state[256] )
{
SERVER_START_REQ( set_key_state )
{
req->tid = GetCurrentThreadId();
req->async = 1;
wine_server_add_data( req, state, 256 );
wine_server_call( req );

View File

@ -3846,10 +3846,8 @@ struct get_key_state_reply
struct set_key_state_request
{
struct request_header __header;
thread_id_t tid;
int async;
/* VARARG(keystate,bytes); */
char __pad_20[4];
};
struct set_key_state_reply
{
@ -6226,7 +6224,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 689
#define SERVER_PROTOCOL_VERSION 690
/* ### protocol_version end ### */

View File

@ -2758,9 +2758,8 @@ enum coords_relative
VARARG(keystate,bytes); /* state array for all the keys */
@END
/* Set queue keyboard state for a given thread */
/* Set queue keyboard state for current thread */
@REQ(set_key_state)
thread_id_t tid; /* id of thread */
int async; /* whether to change the async state too */
VARARG(keystate,bytes); /* state array for all the keys */
@END

View File

@ -3004,30 +3004,18 @@ DECL_HANDLER(get_key_state)
}
/* set queue keyboard state for a given thread */
/* set queue keyboard state for current thread */
DECL_HANDLER(set_key_state)
{
struct thread *thread;
struct desktop *desktop;
data_size_t size = min( 256, get_req_data_size() );
if (!req->tid) /* set global async key state */
if (current->queue) memcpy( current->queue->input->keystate, get_req_data(), size );
if (req->async && (desktop = get_thread_desktop( current, 0 )))
{
if (!(desktop = get_thread_desktop( current, 0 ))) return;
memcpy( desktop->keystate, get_req_data(), size );
release_object( desktop );
}
else
{
if (!(thread = get_thread_from_id( req->tid ))) return;
if (thread->queue) memcpy( thread->queue->input->keystate, get_req_data(), size );
if (req->async && (desktop = get_thread_desktop( thread, 0 )))
{
memcpy( desktop->keystate, get_req_data(), size );
release_object( desktop );
}
release_object( thread );
}
}

View File

@ -1724,9 +1724,8 @@ C_ASSERT( FIELD_OFFSET(struct get_key_state_request, key) == 16 );
C_ASSERT( sizeof(struct get_key_state_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_key_state_reply, state) == 8 );
C_ASSERT( sizeof(struct get_key_state_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, tid) == 12 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, async) == 16 );
C_ASSERT( sizeof(struct set_key_state_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct set_key_state_request, async) == 12 );
C_ASSERT( sizeof(struct set_key_state_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_foreground_window_request, handle) == 12 );
C_ASSERT( sizeof(struct set_foreground_window_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct set_foreground_window_reply, previous) == 8 );

View File

@ -3413,8 +3413,7 @@ static void dump_get_key_state_reply( const struct get_key_state_reply *req )
static void dump_set_key_state_request( const struct set_key_state_request *req )
{
fprintf( stderr, " tid=%04x", req->tid );
fprintf( stderr, ", async=%d", req->async );
fprintf( stderr, " async=%d", req->async );
dump_varargs_bytes( ", keystate=", cur_size );
}