Author: cgutman
Date: Wed Feb 29 06:08:15 2012
New Revision: 55912
URL:
http://svn.reactos.org/svn/reactos?rev=55912&view=rev
Log:
[NTOSKRNL]
- Fix linking of device children to respect the enumeration order instead of linking in
reverse enumeration order
- PCI cards (and other devices) now enumerate in the correct order
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] Wed Feb 29 06:08:15 2012
@@ -1128,10 +1128,17 @@
{
KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql);
Node->Parent = ParentNode;
- Node->Sibling = ParentNode->Child;
- ParentNode->Child = Node;
+ Node->Sibling = NULL;
if (ParentNode->LastChild == NULL)
+ {
+ ParentNode->Child = Node;
ParentNode->LastChild = Node;
+ }
+ else
+ {
+ ParentNode->LastChild->Sibling = Node;
+ ParentNode->LastChild = Node;
+ }
KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql);
Node->Level = ParentNode->Level + 1;
}