Jacek Caban : server: Associate create and close IRPs with current thread.
Alexandre Julliard
julliard at winehq.org
Thu May 30 16:27:13 CDT 2019
Module: wine
Branch: master
Commit: 7f0883ae88a9943155426bba2265eae9efc65744
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7f0883ae88a9943155426bba2265eae9efc65744
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu May 30 13:12:17 2019 +0200
server: Associate create and close IRPs with current thread.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntoskrnl.exe/tests/driver.c | 4 ++++
server/device.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index b61e970..c08452b 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -54,6 +54,7 @@ static int winetest_report_success;
static POBJECT_TYPE *pExEventObjectType, *pIoFileObjectType, *pPsThreadType;
static PEPROCESS *pPsInitialSystemProcess;
+static void *create_caller_thread;
void WINAPI ObfReferenceObject( void *obj );
@@ -356,6 +357,8 @@ static void test_current_thread(BOOL is_system)
ok(PsGetThreadId((PETHREAD)KeGetCurrentThread()) == PsGetCurrentThreadId(), "thread IDs don't match\n");
ok(PsIsSystemThread((PETHREAD)KeGetCurrentThread()) == is_system, "unexpected system thread\n");
+ if (!is_system)
+ ok(create_caller_thread == KeGetCurrentThread(), "thread is not create caller thread\n");
ret = ObOpenObjectByPointer(current, OBJ_KERNEL_HANDLE, NULL, PROCESS_QUERY_INFORMATION, NULL, KernelMode, &process_handle);
ok(!ret, "ObOpenObjectByPointer failed: %#x\n", ret);
@@ -1644,6 +1647,7 @@ static NTSTATUS WINAPI driver_Create(DEVICE_OBJECT *device, IRP *irp)
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
last_created_file = irpsp->FileObject;
+ create_caller_thread = KeGetCurrentThread();
irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(irp, IO_NO_INCREMENT);
diff --git a/server/device.c b/server/device.c
index bc27108..d3e2a84 100644
--- a/server/device.c
+++ b/server/device.c
@@ -475,7 +475,7 @@ static struct object *device_open_file( struct object *obj, unsigned int access,
if ((irp = create_irp( file, ¶ms, NULL )))
{
- add_irp_to_queue( device->manager, irp, NULL );
+ add_irp_to_queue( device->manager, irp, current );
release_object( irp );
}
}
@@ -523,7 +523,7 @@ static int device_file_close_handle( struct object *obj, struct process *process
if ((irp = create_irp( file, ¶ms, NULL )))
{
- add_irp_to_queue( file->device->manager, irp, NULL );
+ add_irp_to_queue( file->device->manager, irp, current );
release_object( irp );
}
}
More information about the wine-cvs
mailing list