Commit 37652d5c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntoskrnl.exe: Set the IRP thread also for create and close requests.

parent 8ce1c66b
......@@ -528,6 +528,7 @@ static NTSTATUS dispatch_create( struct dispatch_context *context )
irpsp->Parameters.Create.EaLength = 0;
irp->Tail.Overlay.OriginalFileObject = file;
irp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread();
irp->RequestorMode = UserMode;
irp->AssociatedIrp.SystemBuffer = NULL;
irp->UserBuffer = NULL;
......@@ -565,6 +566,7 @@ static NTSTATUS dispatch_close( struct dispatch_context *context )
irpsp->FileObject = file;
irp->Tail.Overlay.OriginalFileObject = file;
irp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread();
irp->RequestorMode = UserMode;
irp->AssociatedIrp.SystemBuffer = NULL;
irp->UserBuffer = NULL;
......
......@@ -60,6 +60,8 @@ static POBJECT_TYPE *pExEventObjectType, *pIoFileObjectType, *pPsThreadType, *pI
static PEPROCESS *pPsInitialSystemProcess;
static void *create_caller_thread;
static PETHREAD create_irp_thread;
void WINAPI ObfReferenceObject( void *obj );
NTSTATUS WINAPI ZwQueryInformationProcess(HANDLE,PROCESSINFOCLASS,void*,ULONG,ULONG*);
......@@ -342,7 +344,10 @@ 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");
ok(create_irp_thread == (PETHREAD)KeGetCurrentThread(), "thread of create request is not current thread\n");
}
ret = ObOpenObjectByPointer(current, OBJ_KERNEL_HANDLE, NULL, PROCESS_QUERY_INFORMATION, NULL, KernelMode, &process_handle);
ok(!ret, "ObOpenObjectByPointer failed: %#x\n", ret);
......@@ -1864,6 +1869,7 @@ static NTSTATUS WINAPI driver_Create(DEVICE_OBJECT *device, IRP *irp)
*context = create_count;
irpsp->FileObject->FsContext = context;
create_caller_thread = KeGetCurrentThread();
create_irp_thread = irp->Tail.Overlay.Thread;
irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(irp, IO_NO_INCREMENT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment