From ad0d69c3482fa1d2f200acd8fd074007fcc4d093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 12 Jun 2007 08:38:32 +0000 Subject: [PATCH] Do not create a new device node if we already know the PDO svn path=/trunk/; revision=27153 --- reactos/ntoskrnl/io/iomgr/driver.c | 2 +- reactos/ntoskrnl/io/pnpmgr/plugplay.c | 2 +- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index 3353bcbc7d7..ac1f5aa56b6 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -135,7 +135,7 @@ IopGetDriverObject( if (!NT_SUCCESS(Status)) { - DPRINT1("Failed to reference driver object, status=0x%08x\n", Status); + DPRINT("Failed to reference driver object, status=0x%08x\n", Status); return Status; } diff --git a/reactos/ntoskrnl/io/pnpmgr/plugplay.c b/reactos/ntoskrnl/io/pnpmgr/plugplay.c index 4808f6bb4b9..e3268735ca0 100644 --- a/reactos/ntoskrnl/io/pnpmgr/plugplay.c +++ b/reactos/ntoskrnl/io/pnpmgr/plugplay.c @@ -694,7 +694,7 @@ IopDeviceStatus(PPLUGPLAY_CONTROL_STATUS_DATA StatusData) if (DeviceObject == NULL) return STATUS_NO_SUCH_DEVICE; - DeviceNode = ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode; + DeviceNode = IopGetDeviceNode(DeviceObject); switch (Operation) { diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index 8401a901ab1..b7468d71cda 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -2574,6 +2574,11 @@ IopInvalidateDeviceRelations( */ for (i = 0; i < DeviceRelations->Count; i++) { + if (IopGetDeviceNode(DeviceRelations->Objects[i]) != NULL) + { + ObDereferenceObject(DeviceRelations->Objects[i]); + continue; + } Status = IopCreateDeviceNode( DeviceNode, DeviceRelations->Objects[i],