diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index 8f8ab270329..4441bc7b8fe 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -38,7 +38,8 @@ VOID IoDeviceControlCompletion(PDEVICE_OBJECT DeviceObject, else { IoControlCode = IoStack->Parameters.DeviceIoControl.IoControlCode; - OutputBufferLength = IoStack->Parameters.DeviceIoControl.OutputBufferLength; + OutputBufferLength = NT_SUCCESS(Irp->IoStatus.Status) + ? Irp->IoStatus.Information : 0; } switch (IO_METHOD_FROM_CTL_CODE(IoControlCode))