[USB-BRINGUP-TRUNK]

- Don't send removal IRPs to device nodes already pending removal
- USB device removal and reinsertion works now

svn path=/branches/usb-bringup-trunk/; revision=55087
This commit is contained in:
Cameron Gutman 2012-01-23 00:50:25 +00:00
parent 3de4023a19
commit 9758b6cc87

View file

@ -1824,14 +1824,11 @@ IopHandleDeviceRemoval(
}
}
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 @@ IopPrepareDeviceForRemoval(IN PDEVICE_OBJECT DeviceObject, BOOLEAN Force)
return Status;
}
DeviceNode->Flags |= DNF_WILL_BE_REMOVED;
if (DeviceRelations)
IopSendRemoveDeviceRelations(DeviceRelations);
IopSendRemoveChildDevices(DeviceNode);
@ -4186,7 +4184,6 @@ IopRemoveDevice(PDEVICE_NODE DeviceNode)
IopSendRemoveDevice(DeviceNode->PhysicalDeviceObject);
IopQueueTargetDeviceEvent(&GUID_DEVICE_SAFE_REMOVAL,
&DeviceNode->InstancePath);
DeviceNode->Flags |= DNF_WILL_BE_REMOVED;
return STATUS_SUCCESS;
}