mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[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:
parent
3de4023a19
commit
9758b6cc87
1 changed files with 2 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue