Module: wine Branch: master Commit: 49b834bb42150183c0d707a328a6bf54c7bc010b URL: https://source.winehq.org/git/wine.git/?a=commit;h=49b834bb42150183c0d707a32...
Author: Jacek Caban jacek@codeweavers.com Date: Thu May 30 13:11:52 2019 +0200
server: Use current thread for IRP calls without associated thread.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
server/device.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/server/device.c b/server/device.c index ee7df5a..bc27108 100644 --- a/server/device.c +++ b/server/device.c @@ -951,12 +951,14 @@ DECL_HANDLER(get_next_device_request)
if ((ptr = list_head( &manager->requests ))) { + struct thread *thread; + irp = LIST_ENTRY( ptr, struct irp_call, mgr_entry ); - if (irp->thread) - { - reply->client_thread = get_kernel_object_ptr( manager, &irp->thread->obj ); - reply->client_tid = get_thread_id( irp->thread ); - } + + thread = irp->thread ? irp->thread : current; + reply->client_thread = get_kernel_object_ptr( manager, &thread->obj ); + reply->client_tid = get_thread_id( thread ); + iosb = irp->iosb; reply->in_size = iosb->in_size; if (iosb->in_size > get_reply_max_size()) set_error( STATUS_BUFFER_OVERFLOW );