[ros-diffs] [hbirr] 14964: Do always set the UserIosb of an irp in IoSecondStageCompletion.

hbirr at svn.reactos.com hbirr at svn.reactos.com
Tue May 3 23:42:37 CEST 2005


Do always set the UserIosb of an irp in IoSecondStageCompletion.
Modified: trunk/reactos/ntoskrnl/io/irp.c
  _____  

Modified: trunk/reactos/ntoskrnl/io/irp.c
--- trunk/reactos/ntoskrnl/io/irp.c	2005-05-03 21:25:41 UTC (rev
14963)
+++ trunk/reactos/ntoskrnl/io/irp.c	2005-05-03 21:42:35 UTC (rev
14964)
@@ -1265,14 +1265,18 @@

     }
     Irp->MdlAddress = NULL;
     
+    if (Irp->UserIosb)
+    {
+       /*  Save the IOSB Information */
+       *Irp->UserIosb = Irp->IoStatus;
+    }
+
     /* Check for Success but allow failure for Async IRPs */
     if (NT_SUCCESS(Irp->IoStatus.Status) || 
         (Irp->PendingReturned &&
         !(Irp->Flags & IRP_SYNCHRONOUS_API) &&
         (FileObject == NULL || FileObject->Flags & FO_SYNCHRONOUS_IO)))
     {    
-        /*  Save the IOSB Information */
-        *Irp->UserIosb = Irp->IoStatus;
     
         /* Check if there's an event */
         if (Irp->UserEvent)
@@ -1361,9 +1365,7 @@
             /* Check for SYNC IRP */
             if (Irp->Flags & IRP_SYNCHRONOUS_API)
             {
-                /* Set the status in this case only */
-                *Irp->UserIosb = Irp->IoStatus;
-            
+           
                 /* Signal our event if we have one */
                 if (Irp->UserEvent)
                 {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050503/73492ba9/attachment.html


More information about the Ros-diffs mailing list