Commit 3e0e12d5 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntoskrnl.exe: Call completion callbacks with the correct device.

parent 4da92f32
......@@ -1902,6 +1902,7 @@ VOID WINAPI IoCompleteRequest( IRP *irp, UCHAR priority_boost )
IO_STACK_LOCATION *irpsp;
PIO_COMPLETION_ROUTINE routine;
NTSTATUS status, stat;
DEVICE_OBJECT *device;
int call_flag = 0;
TRACE( "%p %u\n", irp, priority_boost );
......@@ -1923,11 +1924,14 @@ VOID WINAPI IoCompleteRequest( IRP *irp, UCHAR priority_boost )
}
++irp->CurrentLocation;
++irp->Tail.Overlay.s.u2.CurrentStackLocation;
if (irp->CurrentLocation <= irp->StackCount)
device = IoGetCurrentIrpStackLocation(irp)->DeviceObject;
else
device = NULL;
if (call_flag)
{
TRACE( "calling %p( %p, %p, %p )\n", routine,
irpsp->DeviceObject, irp, irpsp->Context );
stat = routine( irpsp->DeviceObject, irp, irpsp->Context );
TRACE( "calling %p( %p, %p, %p )\n", routine, device, irp, irpsp->Context );
stat = routine( device, irp, irpsp->Context );
TRACE( "CompletionRoutine returned %x\n", stat );
if (STATUS_MORE_PROCESSING_REQUIRED == stat)
return;
......
......@@ -1574,7 +1574,7 @@ static unsigned int got_completion;
static NTSTATUS WINAPI completion_cb(DEVICE_OBJECT *device, IRP *irp, void *context)
{
todo_wine ok(device == context, "Got device %p; expected %p.\n", device, context);
ok(device == context, "Got device %p; expected %p.\n", device, context);
++got_completion;
return STATUS_SUCCESS;
}
......
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