Author: cgutman
Date: Mon Mar 26 22:57:01 2012
New Revision: 56240
URL:
http://svn.reactos.org/svn/reactos?rev=56240&view=rev
Log:
[NTOSKRNL]
- Flag the device node if it fails post-start
- Remove the device's children when responding to PNP_DEVICE_REMOVED
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Mon Mar 26 22:57:01 2012
@@ -4044,8 +4044,13 @@
if ((PnPFlags & PNP_DEVICE_REMOVED) ||
((PnPFlags & PNP_DEVICE_FAILED) && !(PnPFlags &
PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED)))
{
- /* Surprise removal */
-
+ /* Flag it if it's failed */
+ if (PnPFlags & PNP_DEVICE_FAILED) DeviceNode->Problem =
CM_PROB_FAILED_POST_START;
+
+ /* Send removal IRPs to all of its children */
+ IopPrepareDeviceForRemoval(PhysicalDeviceObject, TRUE);
+
+ /* Send surprise removal */
IopSendSurpriseRemoval(PhysicalDeviceObject);
/* Tell the user-mode PnP manager that a device was removed */
@@ -4057,7 +4062,6 @@
else if ((PnPFlags & PNP_DEVICE_FAILED) && (PnPFlags &
PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED))
{
/* Stop for resource rebalance */
-
Status = IopStopDevice(DeviceNode);
if (!NT_SUCCESS(Status))
{