From: Alex Ionescu Date: Wed, 9 Nov 2005 04:29:46 +0000 (+0000) Subject: - Fixed two really nasty bugs in I/O completion: X-Git-Tag: backups/ros-branch-0_2_9@19949~813 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=85f0828a18e5e8436c620b2c42f66a7371c1f6bc - Fixed two really nasty bugs in I/O completion: - The user buffer wasn't written for incomplete I/O (warning levels) for METHOD_BUFFERED - Incomplete I/Os (warning levels) took a completely wrong path for completion. svn path=/trunk/; revision=19087 --- diff --git a/reactos/ntoskrnl/io/irp.c b/reactos/ntoskrnl/io/irp.c index b0dc4e022c2..960d6ef3106 100644 --- a/reactos/ntoskrnl/io/irp.c +++ b/reactos/ntoskrnl/io/irp.c @@ -159,7 +159,9 @@ IopCompleteRequest(PKAPC Apc, if (Irp->Flags & IRP_BUFFERED_IO) { /* Check if we have an input buffer and if we suceeded */ - if (Irp->Flags & IRP_INPUT_OPERATION && NT_SUCCESS(Irp->IoStatus.Status)) + if ((Irp->Flags & IRP_INPUT_OPERATION) && + (Irp->IoStatus.Status != STATUS_VERIFY_REQUIRED) && + !(NT_ERROR(Irp->IoStatus.Status))) { /* Copy the buffer back to the user */ RtlCopyMemory(Irp->UserBuffer, @@ -191,10 +193,10 @@ IopCompleteRequest(PKAPC Apc, #if 1 /* Check for Success but allow failure for Async IRPs */ - if (NT_SUCCESS(Irp->IoStatus.Status) || - (Irp->PendingReturned && - !SyncIrp && - (FileObject == NULL || FileObject->Flags & FO_SYNCHRONOUS_IO))) + if (!(NT_ERROR(Irp->IoStatus.Status)) || + ((NT_ERROR(Irp->IoStatus.Status)) && + (Irp->PendingReturned) && !(SyncIrp) && + ((FileObject == NULL) || (FileObject->Flags & FO_SYNCHRONOUS_IO)))) { _SEH_TRY {