Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 10 +++++++--- dlls/ntoskrnl.exe/tests/driver.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index ebdd623eec..b49b288fa9 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -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; diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index f4b373264f..bb5bbeb4fa 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -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; }