Commit 828ac988 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ntoskrnl.exe: Set IRP caller thread.

parent 7f0883ae
......@@ -1363,6 +1363,7 @@ PIRP WINAPI IoBuildDeviceIoControlRequest( ULONG code, PDEVICE_OBJECT device,
irp->UserBuffer = out_buff;
irp->UserIosb = iosb;
irp->UserEvent = event;
irp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread();
return irp;
}
......@@ -1415,6 +1416,7 @@ PIRP WINAPI IoBuildAsynchronousFsdRequest(ULONG majorfunc, DEVICE_OBJECT *device
irp->UserIosb = iosb;
irp->UserEvent = NULL;
irp->UserBuffer = buffer;
irp->Tail.Overlay.Thread = (PETHREAD)KeGetCurrentThread();
return irp;
}
......
......@@ -239,6 +239,8 @@ static void test_irp_struct(IRP *irp, DEVICE_OBJECT *device)
ok(irpsp->DeviceObject == device, "unexpected DeviceObject\n");
ok(irpsp->FileObject->DeviceObject == device, "unexpected FileObject->DeviceObject\n");
ok(!irp->UserEvent, "UserEvent = %p\n", irp->UserEvent);
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
"IRP thread is not the current thread\n");
}
static void test_mdl_map(void)
......@@ -751,6 +753,8 @@ static void test_call_driver(DEVICE_OBJECT *device)
ok(!irp->CancelRoutine, "CancelRoutine = %x\n", irp->CancelRoutine);
ok(!irp->UserEvent, "UserEvent = %p\n", irp->UserEvent);
ok(irp->CurrentLocation == 2, "CurrentLocation = %u\n", irp->CurrentLocation);
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
"IRP thread is not the current thread\n");
irpsp = IoGetNextIrpStackLocation(irp);
ok(irpsp->MajorFunction == IRP_MJ_FLUSH_BUFFERS, "MajorFunction = %u\n", irpsp->MajorFunction);
......@@ -773,6 +777,8 @@ static void test_call_driver(DEVICE_OBJECT *device)
ok(!irp->CancelRoutine, "CancelRoutine = %x\n", irp->CancelRoutine);
ok(irp->UserEvent == &event, "UserEvent = %p\n", irp->UserEvent);
ok(irp->CurrentLocation == 2, "CurrentLocation = %u\n", irp->CurrentLocation);
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
"IRP thread is not the current thread\n");
irpsp = IoGetNextIrpStackLocation(irp);
ok(irpsp->MajorFunction == IRP_MJ_FLUSH_BUFFERS, "MajorFunction = %u\n", irpsp->MajorFunction);
......@@ -1698,6 +1704,8 @@ static NTSTATUS WINAPI driver_FlushBuffers(DEVICE_OBJECT *device, IRP *irp)
{
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp);
ok(irpsp->DeviceObject == device, "device != DeviceObject\n");
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
"IRP thread is not the current thread\n");
IoMarkIrpPending(irp);
return STATUS_PENDING;
}
......
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