Author: cgutman Date: Wed Aug 24 17:05:58 2011 New Revision: 53421
URL: http://svn.reactos.org/svn/reactos?rev=53421&view=rev Log: [HAL] - Handle IRP_MN_QUERY_CAPABILITIES for the ACPI_HAL device object [PNPMGR] - Don't bring up a device if a required IRP has failed - Don't perform operations on a child if it is not ready yet
Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/hal... ============================================================================== --- trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Wed Aug 24 17:05:58 2011 @@ -667,9 +667,16 @@ (PVOID)&Irp->IoStatus.Information); break;
+ case IRP_MN_QUERY_CAPABILITIES: + + /* Call the worker */ + DPRINT("Querying the capabilities for the FDO\n"); + Status = HalpQueryCapabilities(DeviceObject, + IoStackLocation->Parameters.DeviceCapabilities.Capabilities); + break; + default:
- /* Pass it to the PDO */ DPRINT("Other IRP: %lx\n", Minor); Status = Irp->IoStatus.Status; break;
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c... ============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Wed Aug 24 17:05:58 2011 @@ -320,7 +320,7 @@ Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCapabilities); if (!NT_SUCCESS(Status)) { - DPRINT("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); + DPRINT1("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); }
/* Invalidate device state so IRP_MN_QUERY_PNP_DEVICE_STATE is sent */ @@ -762,6 +762,7 @@ }
IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER); + IopDeviceNodeSetFlag(Node, DNF_PROCESSED); IopDeviceNodeSetFlag(Node, DNF_ADDED); IopDeviceNodeSetFlag(Node, DNF_STARTED); } @@ -1523,7 +1524,7 @@ Status = ZwQueryDefaultLocale(FALSE, &LocaleId); if (!NT_SUCCESS(Status)) { - DPRINT("ZwQueryDefaultLocale() failed with status 0x%lx\n", Status); + DPRINT1("ZwQueryDefaultLocale() failed with status 0x%lx\n", Status); return Status; }
@@ -1551,7 +1552,10 @@ } else { - DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); + DPRINT1("IopInitiatePnpIrp() failed (Status %x)\n", Status); + + /* We have to return success otherwise we abort the traverse operation */ + return STATUS_SUCCESS; }
DPRINT("Sending IRP_MN_QUERY_CAPABILITIES to device stack (after enumeration)\n"); @@ -1559,7 +1563,10 @@ Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCapabilities); if (!NT_SUCCESS(Status)) { - DPRINT("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); + DPRINT1("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); + + /* We have to return success otherwise we abort the traverse operation */ + return STATUS_SUCCESS; }
/* This bit is only check after enumeration */ @@ -1579,7 +1586,10 @@ Status = IopGetParentIdPrefix(DeviceNode, &ParentIdPrefix); if (!NT_SUCCESS(Status)) { - DPRINT("IopGetParentIdPrefix() failed (Status 0x%08lx)\n", Status); + DPRINT1("IopGetParentIdPrefix() failed (Status 0x%08lx)\n", Status); + + /* We have to return success otherwise we abort the traverse operation */ + return STATUS_SUCCESS; } }
@@ -1630,6 +1640,9 @@ if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create the instance key! (Status %lx)\n", Status); + + /* We have to return success otherwise we abort the traverse operation */ + return STATUS_SUCCESS; }
IopQueryHardwareIds(DeviceNode, InstanceKey); @@ -2028,6 +2041,12 @@ { DPRINT("Skipping 2+ level child\n"); return STATUS_SUCCESS; + } + + if (!(DeviceNode->Flags & DNF_PROCESSED)) + { + DPRINT1("Child not ready to be configured\n"); + return STATUS_SUCCESS; }
if (!(DeviceNode->Flags & (DNF_DISABLED | DNF_STARTED | DNF_ADDED))) @@ -2155,6 +2174,12 @@ { DPRINT("Skipping 2+ level child\n"); return STATUS_SUCCESS; + } + + if (!(DeviceNode->Flags & DNF_PROCESSED)) + { + DPRINT1("Child not ready to be added\n"); + return STATUS_SUCCESS; }
if (IopDeviceNodeHasFlag(DeviceNode, DNF_STARTED) ||