news 2026/9/24 16:23:04

ACPI!ACPIDetectPdoDevices函数下半部分搜集关联信息

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!ACPIDetectPdoDevices函数下半部分搜集关联信息

ACPI!ACPIDetectPdoDevices函数下半部分搜集关联信息

0: kd> dv newRelationSize
newRelationSize = 5

PCI0
ACAD
CP00
CP01
ACPI\FixedButton


//
// Determine the size of the new relations. Use index as a
// scratch buffer
//
index = sizeof(DEVICE_RELATIONS) +
( sizeof(PDEVICE_OBJECT) * (newRelationSize - 1) );

//
// Allocate the new device relation buffer. Use nonpaged pool since we
// are at dispatch
//
newRelations = ExAllocatePoolWithTag(
NonPagedPool,
index,
ACPI_DEVICE_POOLTAG
);
if (newRelations == NULL) {

//
// Return failure
//
return STATUS_INSUFFICIENT_RESOURCES;

}

//
// Initialize DeviceRelations data structure
//
RtlZeroMemory( newRelations, index );


#define DEV_TYPE_NEVER_PRESENT 0x0000000000000001
#define DEV_TYPE_NOT_PRESENT 0x0000000000000002
#define DEV_TYPE_REMOVED 0x0000000000000004
#define DEV_TYPE_NOT_FOUND 0x0000000000000008
#define DEV_TYPE_FDO 0x0000000000000010
#define DEV_TYPE_PDO 0x0000000000000020
#define DEV_TYPE_FILTER 0x0000000000000040
#define DEV_TYPE_SURPRISE_REMOVED 0x0000000000000080
#define DEV_TYPE_NOT_ENUMERATED 0x0000000000000100

#define DEV_TYPE_PDO 0x0000000000000020
#define DEV_TYPE_NOT_PRESENT 0x0000000000000002
//
// Loop until we get back to the parent
//
while (deviceExtension != NULL) {

//
// The only objects that we care about are those that are marked as
// PDOs and have a phsyical object associated with them
//
if (deviceExtension->Flags & DEV_TYPE_PDO &&
deviceExtension->DeviceObject != NULL &&
!(deviceExtension->Flags & DEV_MASK_NOT_PRESENT) ) {

//
// We don't ObReferenceO here because we are still at
// dispatch level (and for efficiency's sake, we don't
// want to drop down)
//
newRelations->Objects[index] =
deviceExtension->DeviceObject;


0: kd> dt DEVICE_RELATIONS 899875a0
nt!DEVICE_RELATIONS
+0x000 Count : 0
+0x004 Objects : [1] 0x899050e8 _DEVICE_OBJECT
0: kd> dx -id 0,0,899a2278 -r1 (*((ntkrnlmp!_DEVICE_OBJECT * (*)[1])0x899875a4))
(*((ntkrnlmp!_DEVICE_OBJECT * (*)[1])0x899875a4)) [Type: _DEVICE_OBJECT * [1]]
[0] : 0x899050e8 : Device for "\Driver\ACPI" [Type: _DEVICE_OBJECT *]
0: kd> dd 899875a0
899875a0 00000000 899050e8 00000000 00000000
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> r
eax=02010020 ebx=f743b620 ecx=00402000 edx=00402000 esi=899c0d58 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000001


//
// Check to see if we have found all the objects that we care
// about. As in, don't mess the system by walking past the end
// of the device relations
//
if (newRelationSize == index) { //下断点

//
// Done
//
break;

}


0: kd> bp f7400533
0: kd> g
Breakpoint 87 hit
eax=00000000 ebx=f743b620 ecx=2000010a edx=00000000 esi=899ae008 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000001
0: kd> dd 899875a0
899875a0 00000000 899050e8 00000000 00000000
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00000000 ebx=f743b620 ecx=2000010a edx=00000000 esi=899aee58 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000001
0: kd> dd 899875a0
899875a0 00000000 899050e8 00000000 00000000
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00000020 ebx=f743b620 ecx=00406000 edx=00406000 esi=899aec58 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000002
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 00000000
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00000000 ebx=f743b620 ecx=2037010a edx=00000000 esi=899aea40 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000002
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 00000000
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00300020 ebx=f743b620 ecx=8051e010 edx=8051e010 esi=899ab690 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000003
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 8952a6c8
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00000000 ebx=f743b620 ecx=2037010a edx=00000000 esi=8990eaf0 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000003
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 8952a6c8
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00000000 ebx=f743b620 ecx=6030010a edx=00000000 esi=8990e8d8 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000003
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 8952a6c8
899875b0 00000000 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00300020 ebx=f743b620 ecx=8051e010 edx=8051e010 esi=89906008 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000004
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 8952a6c8
899875b0 8952a858 00000000 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268
0: kd> g
Breakpoint 87 hit
eax=00360020 ebx=f743b620 ecx=0058a000 edx=0058a000 esi=89906ea0 edi=899875a0
eip=f7400533 esp=f789a220 ebp=f789a250 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!ACPIDetectPdoDevices+0x355:
f7400533 8b45f4 mov eax,dword ptr [ebp-0Ch] ss:0010:f789a244=00000005
0: kd> dd 899875a0
899875a0 00000000 899050e8 89906690 8952a6c8
899875b0 8952a858 8952a9e8 02050004 46706341
899875c0 89987568 8997706c 00000000 00000001
899875d0 00000001 f740d62c 89907c70 899771c4
899875e0 00180005 46706341 80bf6229 80bf6229
899875f0 020b0002 50706341 8957e130 89900280
89987600 8993eb28 8993eb28 5f534750 8993ea28
89987610 02120006 46706341 898a8188 89961268

//
// Update the size of the relations by the number of matches that we
// successfully made
//
newRelations->Count = index;
newRelationSize = index;


0: kd> dd 899875a0
899875a0 00000005 899050e8 89906690 8952a6c8
899875b0 8952a858 8952a9e8 02050004 46706341
0: kd> dt DEVICE_RELATIONS 899875a0
nt!DEVICE_RELATIONS
+0x000 Count : 5
+0x004 Objects : [1] 0x899050e8 _DEVICE_OBJECT


//
// We have to reference all of the objects that we added
//
index = (currentRelations != NULL ? currentRelations->Count : 0);
for (; index < newRelationSize; index++) {

//
// Attempt to reference the object
//
status = ObReferenceObjectByPointer(
newRelations->Objects[index],
0,
NULL,
KernelMode
);

//
// Update the device relation pointer
//
*DeviceRelations = newRelations;

//
// Done
//
return STATUS_SUCCESS;
}


0: kd> dv DeviceRelations
DeviceRelations = 0xf789a2a4
0: kd> dx -r1 ((ACPI!_DEVICE_RELATIONS * *)0xf789a2a4)
((ACPI!_DEVICE_RELATIONS * *)0xf789a2a4) : 0xf789a2a4 [Type: _DEVICE_RELATIONS * *]
0x899875a0 [Type: _DEVICE_RELATIONS *]
0: kd> dx -r1 ((ACPI!_DEVICE_RELATIONS *)0x899875a0)
((ACPI!_DEVICE_RELATIONS *)0x899875a0) : 0x899875a0 [Type: _DEVICE_RELATIONS *]
[+0x000] Count : 0x5 [Type: unsigned long]
[+0x004] Objects [Type: _DEVICE_OBJECT * [1]]

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

基于深度学习的面部表情识别系统[python]-计算机毕业设计源码+LW文档

摘要&#xff1a;本文详细阐述了一个基于深度学习的面部表情识别系统。首先介绍了面部表情识别的研究背景和意义&#xff0c;接着对涉及的关键技术如深度学习、卷积神经网络等进行了简介。通过需求分析明确了系统的功能和非功能需求&#xff0c;在系统设计部分阐述了系统的架构…

作者头像 李华
网站建设 2026/9/23 22:56:52

厨房扩容秘籍,五大值得信赖的碗柜收纳拉篮品牌推荐

现代厨房中&#xff0c;空间寸土寸金&#xff0c;碗碟餐具、锅具小家电的收纳一直是核心痛点。一个设计精良的碗柜收纳拉篮&#xff0c;能化腐朽为神奇&#xff0c;极大提升空间利用率与厨房美观度。面对市场上琳琅满目的品牌与产品&#xff0c;如何选择&#xff1f;本文将为您…

作者头像 李华
网站建设 2026/9/23 16:01:14

从凭证到云管理员仅需8分钟:AI加速AWS攻击链

AI辅助攻击者利用暴露凭证与宽松权限实现快速提权威胁行为者借助大语言模型&#xff08;LLM&#xff09;&#xff0c;在不到8分钟内完成从凭证窃取、权限提升、横向移动到GPU资源滥用的完整攻击链&#xff0c;其速度之快令防御者几乎无法反应。Sysdig威胁研究团队最新报告显示&…

作者头像 李华
网站建设 2026/9/23 16:02:19

通过postman工具测试一个https post请求

Qwen3-Max 使用 Postman 测试一个 HTTPS POST 请求非常简单,以下是详细步骤: ✅ 前提条件 已安装 Postman 你有目标接口的 URL(例如:https://api.example.com/v1/login) 你知道请求需要的数据格式(如 JSON、表单等)和所需字段 📌 步骤详解 1. 打开 Postman 启动 Po…

作者头像 李华
网站建设 2026/9/23 16:02:50

【网络安全】从入门到顶尖 网络安全行业发展路径指南

文章目录 网络安全行业发展路径与成就达成指南一、行业趋势与核心方向二、发展路径规划 1. 小白入门阶段&#xff08;0-2年&#xff09;2. 进阶高手阶段&#xff08;3-5年&#xff09;3. 成就突破阶段&#xff08;5-10年&#xff09; 三、批判性建议与风险警示四、终极目标达成…

作者头像 李华
网站建设 2026/9/23 16:02:50

微信小程序和HTML5有什么区别,如何互相内嵌使用?

目录 一、微信小程序介绍二、什么是内嵌H5页面三、小程序内嵌H5页面的如何交互四、微信小程序的应用场景 一、微信小程序介绍 微信小程序是一种基于微信平台的轻量级应用&#xff0c;它无需下载安装&#xff0c;用户只需通过微信扫一扫或搜索即可快速打开使用。与传统的APP相比…

作者头像 李华