server: Associate create and close IRPs with current thread.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-05-30 13:12:17 +02:00 committed by Alexandre Julliard
parent e80b507f1e
commit 7f0883ae88
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -475,7 +475,7 @@ static struct object *device_open_file( struct object *obj, unsigned int access,
if ((irp = create_irp( file, &params, 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, &params, NULL )))
{
add_irp_to_queue( file->device->manager, irp, NULL );
add_irp_to_queue( file->device->manager, irp, current );
release_object( irp );
}
}