From ab9dae987d87f2598db44a0265767a3809de4e7e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 19 Aug 2010 23:26:44 +0000 Subject: [PATCH] [NTOSKRNL] - Add a special case to IopInitializeDevice for raw devices - Call IopInitializeDevice to set up our device node and ready it to start - Fixes assertions hit by ACPI and PCIX svn path=/trunk/; revision=48570 --- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index e0ad64b7c72..57215910c0e 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -64,6 +64,13 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode, { PDEVICE_OBJECT Fdo; NTSTATUS Status; + + if (!DriverObject) + { + /* Special case for bus driven devices */ + DeviceNode->Flags |= DNF_ADDED; + return STATUS_SUCCESS; + } if (!DriverObject->DriverExtension->AddDevice) { @@ -1897,11 +1904,15 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, { /* We don't need to worry about loading the driver because we're * being driven in raw mode so our parent must be loaded to get here */ - Status = IopStartDevice(DeviceNode); - if (!NT_SUCCESS(Status)) + Status = IopInitializeDevice(DeviceNode, NULL); + if (NT_SUCCESS(Status)) { - DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n", - &DeviceNode->InstancePath, Status); + Status = IopStartDevice(DeviceNode); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n", + &DeviceNode->InstancePath, Status); + } } } else