根节点DeviceNodeEnumerateCompletion状态完成后下一个节点是子节点PCI0第一个调用的函数是nt!PiProcessNewDeviceNode
case DeviceNodeEnumerateCompletion:
status = PipEnumerateCompleted(currentNode);
nextNode = ChildNode;
break;
switch (nextNode) {
case SameNode:
break;
case ChildNode:
if (currentNode->Child != NULL) {
currentNode = currentNode->Child;
break;
}
0: kd> p
eax=894ffea8 ebx=899c1008 ecx=80ae0dfa edx=80b18978 esi=00000000 edi=00000002
eip=80c9509a esp=f789a398 ebp=f789a5d4 iopl=0 nv up ei ng nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000282
nt!PipProcessDevNodeTree+0x50c:
80c9509a 8bd8 mov ebx,eax
0: kd> !devnode 894ffea8
DevNode 0x894ffea8 for PDO 0x899050e8
Parent 0x899c1008 Sibling 0x8952a1e0 Child 0000000000
State = DeviceNodeUninitialized (0x301)
Previous State = Unknown State (0x0)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x0)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
StateHistory[12] = Unknown State (0x0)
StateHistory[11] = Unknown State (0x0)
StateHistory[10] = Unknown State (0x0)
StateHistory[09] = Unknown State (0x0)
StateHistory[08] = Unknown State (0x0)
StateHistory[07] = Unknown State (0x0)
StateHistory[06] = Unknown State (0x0)
StateHistory[05] = Unknown State (0x0)
StateHistory[04] = Unknown State (0x0)
StateHistory[03] = Unknown State (0x0)
StateHistory[02] = Unknown State (0x0)
StateHistory[01] = Unknown State (0x0)
StateHistory[00] = Unknown State (0x0)
Flags (0x00000010) DNF_ENUMERATED
0: kd> !devobj 899050e8
Device object (899050e8) is for:
00000030 \Driver\ACPI DriverObject 89981f38
Current Irp 00000000 RefCount 0 Type 00000032 Flags 00001040
SecurityDescriptor e1297680 DevExt 899c0d58 DevObjExt 899051a0 DevNode 894ffea8
ExtensionFlags (0000000000)
Characteristics (0x00000080) FILE_AUTOGENERATED_DEVICE_NAME
Device queue is not busy.
0: kd> dt _device_object 899050e8
hal!_DEVICE_OBJECT
+0x000 Type : 0n3
+0x002 Size : 0xb8
+0x004 ReferenceCount : 0n0
+0x008 DriverObject : 0x89981f38 _DRIVER_OBJECT
+0x00c NextDevice : 0x89981b98 _DEVICE_OBJECT
+0x010 AttachedDevice : (null)
+0x014 CurrentIrp : (null)
+0x018 Timer : (null)
+0x01c Flags : 0x1040
+0x020 Characteristics : 0x80
+0x024 Vpb : (null)
+0x028 DeviceExtension : 0x899c0d58 Void
+0x02c DeviceType : 0x32
+0x030 StackSize : 1 ''
+0x034 Queue : __unnamed
+0x05c AlignmentRequirement : 0
+0x060 DeviceQueue : _KDEVICE_QUEUE
+0x074 Dpc : _KDPC
+0x094 ActiveThreadCount : 0
+0x098 SecurityDescriptor : 0xe1297680 Void
+0x09c DeviceLock : _KEVENT
+0x0ac SectorSize : 0
+0x0ae Spare1 : 0
+0x0b0 DeviceObjectExtension : 0x899051a0 _DEVOBJ_EXTENSION
+0x0b4 Reserved : (null)
0: kd> dt acpi!_Device_Extension 0x899c0d58
+0x000 Flags : 0x00402000`02010020
+0x000 UFlags : __unnamed
+0x008 Signature : 0x5f534750
+0x00c DebugFlags : 0
+0x010 DispatchTable : 0xf743830c IRP_DISPATCH_TABLE
+0x014 WorkContext : WORK_QUEUE_CONTEXT
+0x014 Fdo : _FDO_DEVICE_EXTENSION
+0x014 Filter : _FILTER_DEVICE_EXTENSION
+0x014 Pdo : _PDO_DEVICE_EXTENSION
+0x058 WorkQueue : EXTENSION_WORKER
+0x058 Button : BUTTON_EXTENSION
+0x058 Thermal : THERMAL_EXTENSION
+0x058 LinkNode : LINK_NODE_EXTENSION
+0x058 Dock : DOCK_EXTENSION
+0x058 Processor : _PROCESSOR_DEVICE_EXTENSION
+0x088 DeviceState : 0 ( Stopped )
+0x08c PreviousState : 0 ( Stopped )
+0x090 PowerInfo : _ACPI_POWER_INFO
+0x10c DeviceID : 0x899c1148 "ACPI\PNP0A03"
+0x10c Address : 0x899c1148
+0x110 InstanceID : (null)
+0x114 ResourceList : (null)
+0x118 PnpResourceList : (null)
+0x11c OutstandingIrpCount : 0n1
+0x120 ReferenceCount : 0n83
+0x124 HibernatePathCount : 0n0
+0x128 RemoveEvent : (null)
+0x12c AcpiObject : 0x899affac _NSObj
+0x130 DeviceObject : 0x899050e8 _DEVICE_OBJECT
+0x134 TargetDeviceObject : (null)
+0x138 PhysicalDeviceObject : 0x899050e8 _DEVICE_OBJECT
+0x13c ParentExtension : 0x89981a18 _DEVICE_EXTENSION
+0x140 ChildDeviceList : _LIST_ENTRY [ 0x899c0d38 - 0x8990efe8 ]
+0x148 SiblingDeviceList : _LIST_ENTRY [ 0x899ae150 - 0x89981b58 ]
+0x150 EjectDeviceHead : _LIST_ENTRY [ 0x899c0ea8 - 0x899c0ea8 ]
+0x158 EjectDeviceList : _LIST_ENTRY [ 0x899c0eb0 - 0x899c0eb0 ]
0: kd> db 0x899affac
899affac 4c ff 9a 89 ac 40 9b 89-f0 f0 9a 89 24 00 9b 89 L....@......$...
899affbc 50 43 49 30 30 f3 9a 89-4c ff 9a 89 00 00 06 00 PCI00...L.......
899affcc 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
899affdc 58 0d 9c 89 00 00 00 00-48 4f 52 47 34 00 00 00 X.......HORG4...
899affec 00 f0 9a 89 50 00 00 00-30 00 00 00 02 00 00 00 ....P...0.......
899afffc 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
899b000c 00 00 00 00 00 00 00 00-00 00 00 00 48 4e 53 4f ............HNSO
899b001c 44 00 00 00 00 f0 9a 89-64 a0 91 89 68 00 9b 89 D.......d...h...
while (!processComplete) {
//
// Dont process devnodes with problem.
//
status = STATUS_SUCCESS;
nextNode = SiblingNode;
if (!PipDoesDevNodeHaveProblem(currentNode)) {
switch (currentNode->State) {
0: kd> p
eax=894ffea8 ebx=894ffea8 ecx=00000010 edx=80b18978 esi=00000000 edi=00000001
eip=80c94c93 esp=f789a398 ebp=f789a5d4 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
nt!PipProcessDevNodeTree+0x105:
80c94c93 8b4318 mov eax,dword ptr [ebx+18h] ds:0023:894ffec0=00000301
typedef enum _PNP_DEVNODE_STATE {
DeviceNodeUnspecified = 0x300, // 768
DeviceNodeUninitialized, // 769
DeviceNodeInitialized, // 770
DeviceNodeDriversAdded, // 771
DeviceNodeResourcesAssigned, // 772 - Operational state for Added
DeviceNodeStartPending, // 773 - Operational state for Added
DeviceNodeStartCompletion, // 774 - Operational state for Added
DeviceNodeStartPostWork, // 775 - Operational state for Added
DeviceNodeStarted, // 776
DeviceNodeQueryStopped, // 777
DeviceNodeStopped, // 778
DeviceNodeRestartCompletion, // 779 - Operational state for Stopped
DeviceNodeEnumeratePending, // 780 - Operational state for Started
DeviceNodeEnumerateCompletion, // 781 - Operational state for Started
DeviceNodeAwaitingQueuedDeletion, // 782
DeviceNodeAwaitingQueuedRemoval, // 783
DeviceNodeQueryRemoved, // 784
DeviceNodeRemovePendingCloses, // 785
DeviceNodeRemoved, // 786
DeviceNodeDeletePendingCloses, // 787
DeviceNodeDeleted, // 788
MaxDeviceNodeState // 788
} PNP_DEVNODE_STATE, *PPNP_DEVNODE_STATE;
0: kd> ?0n769
Evaluate expression: 769 = 00000301
case DeviceNodeUninitialized:
if (!ProcessOnlyIntermediateStates) {
if (currentNode->Parent == enumeratedBus && startRoot == NULL) {
startRoot = currentNode;
}
if((!ReallocateResources && EnumType == EnumTypeNone) || startRoot) {
status = PiProcessNewDeviceNode(currentNode);
if (NT_SUCCESS(status)) {
nextNode = SameNode;
}
}
}
break;
0: kd> kc
#
00 nt!PiProcessNewDeviceNode
01 nt!PipProcessDevNodeTree
02 nt!PipDeviceActionWorker
03 nt!PipRequestDeviceAction
04 nt!IopInitializeBootDrivers
05 nt!IoInitSystem
06 nt!Phase1Initialization
07 nt!PspSystemThreadStartup
08 nt!KiThreadStartup
0: kd> dv
DeviceNode = 0x894ffea8