[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

svn path=/trunk/; revision=55912
This commit is contained in:
Cameron Gutman 2012-02-29 06:08:15 +00:00
parent 4ba7e8a742
commit bf426aafef

View file

@ -1128,10 +1128,17 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
{
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;
}