判斷裝置的狀態
若要顯示整個裝置樹狀結構,請從根目錄開始,使用 !devnode 0 1:
kd> !devnode 0 1
藉由檢查驅動程式或公開它的匯流排,識別您要搜尋的 devnode。
devnode 狀態旗標描述裝置的狀態。 如需詳細資訊,請參閱 裝置節點狀態旗標。
在 [偵錯隨插即用驅動程式擴充功能] 區段中的 !devnode命令範例中,swenum 裝置是由 PnP 管理員所建立,因此已設定DNF_MADEUP (0x00000001) 旗標。
下列範例顯示 PCI 匯流排所建立的裝置。 此裝置未設定DNF_MADEUP旗標。
0: kd> !devnode 0xfffffa8004483490
DevNode 0xfffffa8004483490 for PDO 0xfffffa800448d060
Parent 0xfffffa80036766d0 Sibling 0xfffffa8004482010 Child 0xfffffa80058ad720
InstancePath is "PCI\VEN_8086&DEV_293C&SUBSYS_2819103C&REV_02\3&21436425&0&D7"
ServiceName is "usbehci"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[09] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[08] = DeviceNodeEnumeratePending (0x30c)
StateHistory[07] = DeviceNodeStarted (0x308)
StateHistory[06] = DeviceNodeStartPostWork (0x307)
...
Flags (0x6c0000f0) DNF_ENUMERATED, DNF_IDS_QUERIED,
DNF_HAS_BOOT_CONFIG, DNF_BOOT_CONFIG_RESERVED,
DNF_NO_LOWER_DEVICE_FILTERS, DNF_NO_LOWER_CLASS_FILTERS,
DNF_NO_UPPER_DEVICE_FILTERS, DNF_NO_UPPER_CLASS_FILTERS
CapabilityFlags (0x00002000) WakeFromD3
範例
- 裝置的 devnode 資源不足:
kd> !devnode 0xff0d06e8 6
DevNode 0xff0d06e8 for PDO 0xff0d07d0 at level 0x3
Parent 0xff0d1408 Sibling 0000000000 Child 0000000000
InterfaceType 0xffffffff Bus Number 0xfffffff0
InstancePath is "ISAPNP\SUP2171\00000067"
ServiceName is "Modem"
TargetDeviceNotify List - f 0xff0d074c b 0xff0d074c
Flags (..........) DNF_PROCESSED, DNF_ENUMERATED,
DNF_INSUFFICIENT_RESOURCES, DNF_ADDED,
DNF_HAS_BOOT_CONFIG
Unknown flags 0x40000000
IoResList at 0xe133e7a8 : Interface 0x1 Bus 0 Slot 0
Alternative 0 (Version 1.1)
Preferred Descriptor 0 - NonArbitrated/ConfigData (0x80) Shared (0x3)
Flags (0000) -
Data: : 0x0 0x61004d 0x680063
Preferred Descriptor 1 - Port (0x1) Undetermined Sharing (0)
Flags (0x11) - PORT_IO 16_BIT_DECODE
0x000008 byte range with alignment 0x000001
2f8 - 0x2ff
Preferred Descriptor 2 - Interrupt (0x2) Shared (0x3)
Flags (0x01) - LATCHED
0x3 - 0x3
請注意,devnode 沒有 CM 資源清單,因為它未啟動,而且未使用資源,但已要求資源。
- 請注意,此 devnode 中沒有針對舊版驅動程式儲存的資源。
kd> !devnode 0xff0d1648 6
DevNode 0xff0d1648 for PDO 0xff0d22d0 at level 0x2
Parent 0xff0d2e28 Sibling 0xff0d1588 Child 0000000000
InterfaceType 0xffffffff Bus Number 0xffffffff
InstancePath is "PCI\VEN_102B&DEV_0519\0&60"
ServiceName is "mga_mil"
TargetDeviceNotify List - f 0xff0d16ac b 0xff0d16ac
Flags (0x6000500b) DNF_PROCESSED, DNF_STARTED,
DNF_ENUMERATED, DNF_ADDED,
DNF_LEGACY_DRIVER, DNF_HAS_BOOT_CONFIG
Unknown flags 0x40000000
您可以擷取下列裝置類型的驅動程式裝置物件清單:
kd> !drvobj mga_mil
Driver object (ff0bbc10) is for:
\Driver\mga_mil
Driver Extension List: (id , addr)
Device Object list:
ff0bb900
然後,您可以傾印此裝置物件的資料:
kd> !devobj ff0bb900
Device object (ff0bb900) is for:
Video0 \Driver\mga_mil DriverObject ff0bbc10
Current Irp 00000000 RefCount 1 Type 00000023 Flags 0000204c
DevExt ff0bb9b8 DevNode ff0bb808
Device queue is not busy.
最後,您可以傾印裝置物件所參考的 devnode。 此 devnode 不會連結在裝置樹狀結構中。 它代表用來宣告舊版裝置資源的「虛擬開發節點」。 請注意指出裝置為回報偵測到裝置的DNF_RESOURCE_REPORTED旗標。
kd> !devnode ff0bb808 6
DevNode 0xff0bb808 for PDO 0xff0bb900 at level 0xffffffff
Parent 0xff0daf48 Sibling 0000000000 Child 0000000000
InterfaceType 0xffffffff Bus Number 0xffffffff
TargetDeviceNotify List - f 0xff0bb86c b 0xff0bb86c
Flags (0x00000400) DNF_RESOURCE_REPORTED
CmResourceList at 0xe12474e8 Version 0.0 Interface 0x5 Bus #0
Entry 0 - Port (0x1) Shared (0x3)
Flags (0x01) - PORT_MEMORY PORT_IO
Range starts at 0x3c0 for 0x10 bytes
Entry 1 - Port (0x1) Shared (0x3)
Flags (0x01) - PORT_MEMORY PORT_IO
Range starts at 0x3d4 for 0x8 bytes
Entry 2 - Port (0x1) Shared (0x3)
Flags (0x01) - PORT_MEMORY PORT_IO
Range starts at 0x3de for 0x2 bytes
Entry 3 - Memory (0x3) Device Exclusive (0x1)
Flags (0000) - READ_WRITE
Range starts at 0x0000000040000000 for 0x4000 bytes
Entry 4 - Memory (0x3) Device Exclusive (0x1)
Flags (0000) - READ_WRITE
Range starts at 0x0000000040800000 for 0x800000 bytes