Author: cgutman
Date: Mon Aug 15 00:17:42 2011
New Revision: 53245
URL:
http://svn.reactos.org/svn/reactos?rev=53245&view=rev
Log:
[NTOSKRNL]
- Add a debug print when AddDevice fails
- Fix IopStopDevice
- Fix a typo
- Reduce code duplication
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 Aug 15 00:17:42 2011
@@ -95,6 +95,10 @@
DriverObject, DeviceNode->PhysicalDeviceObject);
if (!NT_SUCCESS(Status))
{
+ DPRINT1("%wZ->AddDevice(%wZ) failed with status 0x%x\n",
+ &DriverObject->DriverName,
+ &DeviceNode->InstancePath,
+ Status);
IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
return Status;
}
@@ -393,9 +397,13 @@
DPRINT("Stopping device: %wZ\n", &DeviceNode->InstancePath);
Status = IopQueryStopDevice(DeviceNode->PhysicalDeviceObject);
- if (!NT_SUCCESS(Status))
+ if (NT_SUCCESS(Status))
{
IopSendStopDevice(DeviceNode->PhysicalDeviceObject);
+
+ DeviceNode->Flags &= ~(DNF_STARTED | DNF_START_REQUEST_PENDING);
+ DeviceNode->Flags |= DNF_STOPPED;
+
return STATUS_SUCCESS;
}
@@ -490,7 +498,7 @@
if (DeviceCaps->NoDisplayInUI)
DeviceNode->UserFlags |= DNUF_DONT_SHOW_IN_UI;
else
- DeviceNode->UserFlags &= DNUF_DONT_SHOW_IN_UI;
+ DeviceNode->UserFlags &= ~DNUF_DONT_SHOW_IN_UI;
Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, 0,
&InstanceKey);
if (NT_SUCCESS(Status))
@@ -3720,12 +3728,13 @@
{
/* Stop for resource rebalance */
- if (NT_SUCCESS(IopQueryStopDevice(PhysicalDeviceObject)))
+ Status = IopStopDevice(DeviceNode);
+ if (!NT_SUCCESS(Status))
{
- IopSendStopDevice(PhysicalDeviceObject);
-
- DeviceNode->Flags &= ~(DNF_STARTED | DNF_START_REQUEST_PENDING);
- DeviceNode->Flags |= DNF_STOPPED;
+ DPRINT1("Failed to stop device for rebalancing\n");
+
+ /* Stop failed so don't rebalance */
+ PnPFlags &= ~PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED;
}
}