[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 10 May 2015 20:56:48 +0000 (20:56 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 10 May 2015 20:56:48 +0000 (20:56 +0000)
- Only set the IOSB status if we complete the IRP
- Fix the assert: the caller might want not to complete the IRP nor to queue it (passed down IRPs)

svn path=/trunk/; revision=67636

reactos/drivers/filesystems/ntfs/dispatch.c

index 0f53c62..ebba60e 100644 (file)
@@ -85,13 +85,17 @@ NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject,
     else
         Status = STATUS_INSUFFICIENT_RESOURCES;
 
-    ASSERT(((IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
+    ASSERT((!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
+           ((IrpContext->Flags & IRPCONTEXT_COMPLETE) && !(IrpContext->Flags & IRPCONTEXT_QUEUE)) ||
            (!(IrpContext->Flags & IRPCONTEXT_COMPLETE) && (IrpContext->Flags & IRPCONTEXT_QUEUE)));
 
-    Irp->IoStatus.Status = Status;
+
 
     if (IrpContext->Flags & IRPCONTEXT_COMPLETE)
+    {
+        Irp->IoStatus.Status = Status;
         IoCompleteRequest(Irp, IrpContext->PriorityBoost);
+    }
 
     if (IrpContext)
         ExFreePoolWithTag(IrpContext, 'PRIN');