diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 11c9f4a32af..d570a61f4bb 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -981,6 +981,7 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ) client_tid = reply->client_tid; in_size = reply->in_size; out_size = reply->out_size; + NtCurrentTeb()->Reserved5[1] = wine_server_get_ptr( reply->client_thread ); } else { diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 60b02f74ed8..88b933cc14e 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -5240,12 +5240,11 @@ struct get_next_device_request_reply struct reply_header __header; irp_params_t params; obj_handle_t next; - process_id_t client_pid; thread_id_t client_tid; + client_ptr_t client_thread; data_size_t in_size; data_size_t out_size; /* VARARG(next_data,bytes); */ - char __pad_52[4]; }; @@ -6647,6 +6646,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 577 +#define SERVER_PROTOCOL_VERSION 578 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/device.c b/server/device.c index 7ee10cb3ea3..c798694875b 100644 --- a/server/device.c +++ b/server/device.c @@ -866,8 +866,8 @@ DECL_HANDLER(get_next_device_request) irp = LIST_ENTRY( ptr, struct irp_call, mgr_entry ); if (irp->thread) { - reply->client_pid = get_process_id( irp->thread->process ); - reply->client_tid = get_thread_id( irp->thread ); + reply->client_thread = get_kernel_object_ptr( manager, &irp->thread->obj ); + reply->client_tid = get_thread_id( irp->thread ); } reply->params = irp->params; iosb = irp->iosb; diff --git a/server/protocol.def b/server/protocol.def index 5adc83db8b9..b6ad514463f 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3618,8 +3618,8 @@ struct handle_info @REPLY irp_params_t params; /* irp parameters */ obj_handle_t next; /* handle to the next irp */ - process_id_t client_pid; /* pid of process calling irp */ thread_id_t client_tid; /* tid of thread calling irp */ + client_ptr_t client_thread; /* pointer to thread object of calling irp */ data_size_t in_size; /* total needed input size */ data_size_t out_size; /* needed output size */ VARARG(next_data,bytes); /* input data of the next irp */ diff --git a/server/request.h b/server/request.h index b10ccd9e700..a3e95137e10 100644 --- a/server/request.h +++ b/server/request.h @@ -2287,10 +2287,10 @@ C_ASSERT( FIELD_OFFSET(struct get_next_device_request_request, status) == 20 ); C_ASSERT( sizeof(struct get_next_device_request_request) == 24 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, params) == 8 ); C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, next) == 32 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_pid) == 36 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_tid) == 40 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 44 ); -C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 48 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_tid) == 36 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, client_thread) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, in_size) == 48 ); +C_ASSERT( FIELD_OFFSET(struct get_next_device_request_reply, out_size) == 52 ); C_ASSERT( sizeof(struct get_next_device_request_reply) == 56 ); C_ASSERT( FIELD_OFFSET(struct get_kernel_object_ptr_request, manager) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_kernel_object_ptr_request, handle) == 16 ); diff --git a/server/trace.c b/server/trace.c index 35628236592..d4d0c3eb8df 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4285,8 +4285,8 @@ static void dump_get_next_device_request_reply( const struct get_next_device_req { dump_irp_params( " params=", &req->params ); fprintf( stderr, ", next=%04x", req->next ); - fprintf( stderr, ", client_pid=%04x", req->client_pid ); fprintf( stderr, ", client_tid=%04x", req->client_tid ); + dump_uint64( ", client_thread=", &req->client_thread ); fprintf( stderr, ", in_size=%u", req->in_size ); fprintf( stderr, ", out_size=%u", req->out_size ); dump_varargs_bytes( ", next_data=", cur_size );