[NTOSKRNL]
authorCameron Gutman <aicommander@gmail.com>
Sun, 4 Apr 2010 21:43:51 +0000 (21:43 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sun, 4 Apr 2010 21:43:51 +0000 (21:43 +0000)
- Revert r46720 and fix the issue properly

svn path=/trunk/; revision=46724

reactos/ntoskrnl/io/iomgr/irp.c
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c

index 21870d5..0863f58 100644 (file)
@@ -460,22 +460,6 @@ IopCompleteRequest(IN PKAPC Apc,
     }
     else
     {
     }
     else
     {
-        /* Check if we have an associated user IOSB */
-        if (Irp->UserIosb)
-        {
-            /* We do, so let's give them the final status */
-            _SEH2_TRY
-            {
-               /*  Save the IOSB Information */
-               *Irp->UserIosb = Irp->IoStatus;
-            }
-            _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
-            {
-               /* Ignore any error */
-            }
-            _SEH2_END;
-        }
-
         /*
          * Either we didn't return from the request, or we did return but this
          * request was synchronous.
         /*
          * Either we didn't return from the request, or we did return but this
          * request was synchronous.
@@ -485,6 +469,9 @@ IopCompleteRequest(IN PKAPC Apc,
             /* So we did return with a synch operation, was it the IRP? */
             if (Irp->Flags & IRP_SYNCHRONOUS_API)
             {
             /* So we did return with a synch operation, was it the IRP? */
             if (Irp->Flags & IRP_SYNCHRONOUS_API)
             {
+                /* Yes, this IRP was synchronous, so return the I/O Status */
+                *Irp->UserIosb = Irp->IoStatus;
+
                 /* Now check if the user gave an event */
                 if (Irp->UserEvent)
                 {
                 /* Now check if the user gave an event */
                 if (Irp->UserEvent)
                 {
index 5d6c133..0213d04 100644 (file)
@@ -163,7 +163,10 @@ IopStartDevice(
       DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n");
       return Status;
    }
       DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n");
       return Status;
    }
-   DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+   else if (NT_SUCCESS(Status))
+   {
+      DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information;
+   }
 
    Status = IopAssignDeviceResources(DeviceNode, &RequiredLength);
    if (NT_SUCCESS(Status))
 
    Status = IopAssignDeviceResources(DeviceNode, &RequiredLength);
    if (NT_SUCCESS(Status))