[ros-diffs] [cgutman] 55087: [USB-BRINGUP-TRUNK] - Don't send removal IRPs to device nodes already pending removal - USB device removal and reinsertion works now

cgutman at svn.reactos.org cgutman at svn.reactos.org
Mon Jan 23 00:50:25 UTC 2012


Author: cgutman
Date: Mon Jan 23 00:50:25 2012
New Revision: 55087

URL: http://svn.reactos.org/svn/reactos?rev=55087&view=rev
Log:
[USB-BRINGUP-TRUNK]
- Don't send removal IRPs to device nodes already pending removal
- USB device removal and reinsertion works now

Modified:
    branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c

Modified: branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c?rev=55087&r1=55086&r2=55087&view=diff
==============================================================================
--- branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Mon Jan 23 00:50:25 2012
@@ -1824,13 +1824,10 @@
             }
         }
 
-        if (!Found)
+        if (!Found && !(Child->Flags & DNF_WILL_BE_REMOVED))
         {
             /* Send removal IRPs to all of its children */
             IopPrepareDeviceForRemoval(Child->PhysicalDeviceObject, TRUE);
-
-            /* Set the flag */
-            Child->Flags |= DNF_WILL_BE_REMOVED;
 
             /* Send the surprise removal IRP */
             IopSendSurpriseRemoval(Child->PhysicalDeviceObject);
@@ -4166,6 +4163,7 @@
         return Status;
     }
 
+    DeviceNode->Flags |= DNF_WILL_BE_REMOVED;
     if (DeviceRelations)
         IopSendRemoveDeviceRelations(DeviceRelations);
     IopSendRemoveChildDevices(DeviceNode);
@@ -4186,7 +4184,6 @@
         IopSendRemoveDevice(DeviceNode->PhysicalDeviceObject);
         IopQueueTargetDeviceEvent(&GUID_DEVICE_SAFE_REMOVAL,
                                   &DeviceNode->InstancePath);
-        DeviceNode->Flags |= DNF_WILL_BE_REMOVED;
         return STATUS_SUCCESS;
     }
 




More information about the Ros-diffs mailing list