news 2026/4/18 5:19:57

ACPI!ACPIBuildProcessDevicePhaseSta函数对ISA的处理ACPI!ACPIDetectDuplicateHID

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!ACPIBuildProcessDevicePhaseSta函数对ISA的处理ACPI!ACPIDetectDuplicateHID

ACPI!ACPIBuildProcessDevicePhaseSta函数对ISA的处理ACPI!ACPIDetectDuplicateHID

1: kd> t
Breakpoint 5 hit
eax=00000008 ebx=00000008 ecx=89984198 edx=00000001 esi=89984188 edi=80b019f4
eip=f73fb911 esp=f78aef68 ebp=f78aef84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
ACPI!ACPIBuildProcessGenericList+0x4d:
f73fb911 ff55f4 call dword ptr [ebp-0Ch] ss:0010:f78aef78={ACPI!ACPIBuildProcessDevicePhaseSta (f73fb72e)}


1: kd> t
eax=00000008 ebx=00000008 ecx=89984198 edx=00000001 esi=89984188 edi=80b019f4
eip=f73fb72e esp=f78aef64 ebp=f78aef84 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
ACPI!ACPIBuildProcessDevicePhaseSta:
f73fb72e 55 push ebp
1: kd> kc
#
00 ACPI!ACPIBuildProcessDevicePhaseSta
01 ACPI!ACPIBuildProcessGenericList
02 ACPI!ACPIBuildDeviceDpc
03 nt!KiRetireDpcList
04 nt!KiDispatchInterrupt
WARNING: Frame IP not in any known module. Following frames may be wrong.
05 0x0
1: kd> dv
BuildRequest = 0x89984188


#define WORK_DONE_EJD WORK_DONE_STEP_6

//
// The next stage is to start running the _EJD
//
BuildRequest->NextWorkDone = WORK_DONE_EJD;


//
// See if the device conforms to the ACPI specification for HIDs and UIDs
// We do this at this point because we now know wether or not the device
// is present or not and that is an important test because the OEM is
// allowed to have 2 devices with the same HID/UID as long as both aren't
// present at the same time.
//检查设备是否符合HIDs和UIDs的ACPI规范。我们在此处进行此项测试,因为我们现在已知设备是否存在,这是一项重要测试,
//因为OEM可以有两台设备具有相同的HID/UID,只要它们不同时存在即可
ACPIDetectDuplicateHID(
deviceExtension
);


This routine looks at all the sibling devices of the specified
device and determines if there are devices with duplicate HIDs and
UIDs

此例程会查看指定设备的所有同级设备,并判断是否存在具有重复硬件标识符(HID)和唯一标识符(UID)的设备


1: kd> kc
#
00 ACPI!ACPIDetectDuplicateHID
01 ACPI!ACPIBuildProcessDevicePhaseSta
02 ACPI!ACPIBuildProcessGenericList
03 ACPI!ACPIBuildDeviceDpc
04 nt!KiRetireDpcList
05 nt!KiDispatchInterrupt
WARNING: Frame IP not in any known module. Following frames may be wrong.
06 0x0
1: kd> dv
DeviceExtension = 0x899c0a88
eled = struct EXTENSIONLIST_ENUMDATA
1: kd> dx -r1 ((ACPI!_DEVICE_EXTENSION *)0x899c0a88)
((ACPI!_DEVICE_EXTENSION *)0x899c0a88) : 0x899c0a88 [Type: _DEVICE_EXTENSION *]
[+0x000] Flags : 0x40100000000008 [Type: unsigned __int64]
[+0x000] UFlags [Type: __unnamed]
[+0x008] Signature : 0x5f534750 [Type: unsigned long]
[+0x00c] DebugFlags : 0x0 [Type: unsigned long]
[+0x010] DispatchTable : 0x0 [Type: IRP_DISPATCH_TABLE *]
[+0x014] WorkContext [Type: WORK_QUEUE_CONTEXT]
[+0x014] Fdo [Type: _FDO_DEVICE_EXTENSION]
[+0x014] Filter [Type: _FILTER_DEVICE_EXTENSION]
[+0x014] Pdo [Type: _PDO_DEVICE_EXTENSION]
[+0x058] WorkQueue [Type: EXTENSION_WORKER]
[+0x058] Button [Type: BUTTON_EXTENSION]
[+0x058] Thermal [Type: THERMAL_EXTENSION]
[+0x058] LinkNode [Type: LINK_NODE_EXTENSION]
[+0x058] Dock [Type: DOCK_EXTENSION]
[+0x058] Processor [Type: _PROCESSOR_DEVICE_EXTENSION]
[+0x088] DeviceState : Stopped (0) [Type: _ACPI_DEVICE_STATE]
[+0x08c] PreviousState : Stopped (0) [Type: _ACPI_DEVICE_STATE]
[+0x090] PowerInfo [Type: _ACPI_POWER_INFO]
[+0x10c] DeviceID : 0x70000 : Unable to read memory at Address 0x70000 [Type: unsigned char *]
[+0x10c] Address : 0x70000 [Type: unsigned long]
[+0x110] InstanceID : 0x0 [Type: unsigned char *]
[+0x114] ResourceList : 0x0 [Type: _CM_RESOURCE_LIST *]
[+0x118] PnpResourceList : 0x0 [Type: _ObjData *]
[+0x11c] OutstandingIrpCount : 1 [Type: long]
[+0x120] ReferenceCount : 52 [Type: long]
[+0x124] HibernatePathCount : 0 [Type: long]
[+0x128] RemoveEvent : 0x0 [Type: _KEVENT *]
[+0x12c] AcpiObject : 0x899b2278 [Type: _NSObj *]
[+0x130] DeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x134] TargetDeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x138] PhysicalDeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x13c] ParentExtension : 0x899c0d58 [Type: _DEVICE_EXTENSION *]
[+0x140] ChildDeviceList [Type: _LIST_ENTRY]
[+0x148] SiblingDeviceList [Type: _LIST_ENTRY]
[+0x150] EjectDeviceHead [Type: _LIST_ENTRY]
[+0x158] EjectDeviceList [Type: _LIST_ENTRY]
1: kd> db 0x899b2278
899b2278 bc 21 9b 89 68 3c 9b 89-ac ff 9a 89 bc 22 9b 89 .!..h<......."..
899b2288 49 53 41 5f 30 f3 9a 89-34 22 9b 89 00 00 06 00 ISA_0...4"......
899b2298 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
899b22a8 88 0a 9c 89 00 00 00 00-48 4e 53 4f 44 00 00 00 ........HNSOD...
899b22b8 00 f0 9a 89 0c e5 9b 89-00 23 9b 89 78 22 9b 89 .........#..x"..
899b22c8 00 00 00 00 5f 41 44 52-30 f3 9a 89 78 22 9b 89 ...._ADR0...x"..
899b22d8 00 00 01 00 00 00 00 00-00 00 07 00 00 00 00 00 ................
899b22e8 00 00 00 00 00 00 00 00-00 00 00 00 48 4e 53 4f ............HNSO
1: kd> dx -r1 ((ACPI!_DEVICE_EXTENSION *)0x899c0d58)
((ACPI!_DEVICE_EXTENSION *)0x899c0d58) : 0x899c0d58 [Type: _DEVICE_EXTENSION *]
[+0x000] Flags : 0x40200002000008 [Type: unsigned __int64]
[+0x000] UFlags [Type: __unnamed]
[+0x008] Signature : 0x5f534750 [Type: unsigned long]
[+0x00c] DebugFlags : 0x0 [Type: unsigned long]
[+0x010] DispatchTable : 0x0 [Type: IRP_DISPATCH_TABLE *]
[+0x014] WorkContext [Type: WORK_QUEUE_CONTEXT]
[+0x014] Fdo [Type: _FDO_DEVICE_EXTENSION]
[+0x014] Filter [Type: _FILTER_DEVICE_EXTENSION]
[+0x014] Pdo [Type: _PDO_DEVICE_EXTENSION]
[+0x058] WorkQueue [Type: EXTENSION_WORKER]
[+0x058] Button [Type: BUTTON_EXTENSION]
[+0x058] Thermal [Type: THERMAL_EXTENSION]
[+0x058] LinkNode [Type: LINK_NODE_EXTENSION]
[+0x058] Dock [Type: DOCK_EXTENSION]
[+0x058] Processor [Type: _PROCESSOR_DEVICE_EXTENSION]
[+0x088] DeviceState : Stopped (0) [Type: _ACPI_DEVICE_STATE]
[+0x08c] PreviousState : Stopped (0) [Type: _ACPI_DEVICE_STATE]
[+0x090] PowerInfo [Type: _ACPI_POWER_INFO]
[+0x10c] DeviceID : 0x899c1148 : 0x41 [Type: unsigned char *]
[+0x10c] Address : 0x899c1148 [Type: unsigned long]
[+0x110] InstanceID : 0x0 [Type: unsigned char *]
[+0x114] ResourceList : 0x0 [Type: _CM_RESOURCE_LIST *]
[+0x118] PnpResourceList : 0x0 [Type: _ObjData *]
[+0x11c] OutstandingIrpCount : 1 [Type: long]
[+0x120] ReferenceCount : 82 [Type: long]
[+0x124] HibernatePathCount : 0 [Type: long]
[+0x128] RemoveEvent : 0x0 [Type: _KEVENT *]
[+0x12c] AcpiObject : 0x899affac [Type: _NSObj *]
[+0x130] DeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x134] TargetDeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x138] PhysicalDeviceObject : 0x0 [Type: _DEVICE_OBJECT *]
[+0x13c] ParentExtension : 0x89981a18 [Type: _DEVICE_EXTENSION *]
[+0x140] ChildDeviceList [Type: _LIST_ENTRY]
[+0x148] SiblingDeviceList [Type: _LIST_ENTRY]
[+0x150] EjectDeviceHead [Type: _LIST_ENTRY]
[+0x158] EjectDeviceList [Type: _LIST_ENTRY]
1: 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...
1: kd> db 0x899c1148
899c1148 41 43 50 49 5c 50 4e 50-30 41 30 33 00 00 00 00 ACPI\PNP0A03....

PDEVICE_EXTENSION parentExtension = DeviceExtension->ParentExtension; ebx=899c0d58

//
// Is this the root of the device tree?
//
if (parentExtension == NULL) {

return;

}

1: kd> p
eax=00000000 ebx=899c0d58 ecx=80ae0dfa edx=80b18958 esi=89984188 edi=899c0a88
eip=f73ffa75 esp=f78aef2c ebp=f78aef4c iopl=0 nv up ei ng nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000282
ACPI!ACPIDetectDuplicateHID+0x11:
f73ffa75 85db test ebx,ebx


//
// Do we fail to eject a PDO for this device? Or does this device not have
// an _HID? 这个设备没有HID!!!
//
if ( (DeviceExtension->Flags & DEV_TYPE_NEVER_PRESENT) ||
(DeviceExtension->Flags & DEV_MASK_NOT_PRESENT) ||
!(DeviceExtension->Flags & DEV_MASK_HID) ) {

return; //直接返回了。

}

#define DEV_TYPE_NEVER_PRESENT 0x0000000000000001
#define DEV_TYPE_NOT_PRESENT 0x0000000000000002
#define DEV_PROP_FAILED_INIT 0x00020000 00000000

#define DEV_MASK_NOT_PRESENT (DEV_TYPE_NOT_PRESENT | DEV_PROP_FAILED_INIT)


#define DEV_MASK_HID (DEV_PROP_HID | DEV_PROP_FIXED_HID)
#define DEV_PROP_HID 0x00002000 00000000
#define DEV_PROP_FIXED_HID 0x00008000 00000000


Device (ISA)
{
Name (_ADR, 0x00070000) // _ADR: Address
Device (MBRD)
{

Device (ISA)对应的:
1: kd> dx -r1 ((ACPI!_DEVICE_EXTENSION *)0x899c0a88)
((ACPI!_DEVICE_EXTENSION *)0x899c0a88) : 0x899c0a88 [Type: _DEVICE_EXTENSION *]
[+0x000] Flags : 0x401000 00000008 [Type: unsigned __int64]


Device (PCI0)
{
Name (_HID, EisaId ("PNP0A03")) // _HID: Hardware ID
Name (_CID, EisaId ("PNP0A08")) // _CID: Compatible ID
Name (_BBN, 0x00) // _BBN: BIOS Bus Number
Name (_ADR, 0x00) // _ADR: Address

Device (PCI0)对应的:
1: kd> dx -r1 ((ACPI!_DEVICE_EXTENSION *)0x899c0d58)
((ACPI!_DEVICE_EXTENSION *)0x899c0d58) : 0x899c0d58 [Type: _DEVICE_EXTENSION *]
[+0x000] Flags : 0x402000 02000008 [Type: unsigned __int64]

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/15 16:00:37

Node.js诊断报告生成器一键定位性能瓶颈

&#x1f493; 博客主页&#xff1a;瑕疵的CSDN主页 &#x1f4dd; Gitee主页&#xff1a;瑕疵的gitee主页 ⏩ 文章专栏&#xff1a;《热点资讯》 目录 Node.js性能瓶颈的“数字听诊器”&#xff1a;诊断报告生成器架构解密与实战指南 一、为何需要专用诊断报告生成器&#xff…

作者头像 李华
网站建设 2026/3/17 11:37:36

16.QT工程后缀名解释

一般一个QT上位机工程目录如下图所示&#xff1a;后缀名分别代表的含义&#xff1a;1. .qmake.stash这是 Qt 的 qmake 工具在构建项目时生成的缓存文件。它会保存项目配置、依赖关系等临时信息&#xff0c;用于加速后续的构建过程。一般不需要手动修改或提交到版本控制。2. .pr…

作者头像 李华
网站建设 2026/4/16 23:04:45

每日面试题分享164:HTTP与RPC之间的区别?

严格来说&#xff0c;HTTP和RPC不是一个层面的东西。HTTP是一种应用层的协议&#xff0c;强调的是网络通信。RPC是一种分布式系统之间通信的方式&#xff0c;强调的是服务之间的远程调用。一些RPC框架的底层是HTTP&#xff0c;比如g RPC和Dubbo。

作者头像 李华
网站建设 2026/4/17 18:39:20

工业控制界面异常状态的多维测试策略与实践指南

一、ICS测试的特殊性与核心挑战 工业控制系统深度融合物理设备与信息网络&#xff0c;其异常检测需兼顾实时响应、设备安全与数据完整性。传统软件测试方法在以下场景存在局限&#xff1a; 攻击面扩大&#xff1a;APT攻击利用0-day漏洞穿透常规检测 状态复杂性&#xff1a;设…

作者头像 李华