当前位置: 首页 > news >正文

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]]

http://www.jsqmd.com/news/340640/

相关文章:

  • JOULWATT杰华特 JW5062TTSOTB#TRPBF TSOT23-6 DC-DC电源芯片
  • 2026年天津遗产纠纷律师联系电话推荐:专业律师团队深度解析 - 品牌推荐
  • 佛山天象文仪办公家具选购要点,品牌口碑好吗 - 工业品网
  • 每日面试题分享175:什么是路由守卫?
  • 2026年厂房地坪工程厂家实力推荐:四川固贝尔,混凝土一体化/环氧/固化/修复施工全系服务,适配工业仓储多场景 - 品牌推荐官
  • 探讨深圳市FLYBROW飞艇汽车用品,价格费用怎么算 - 工业设备
  • 2026年合肥靠谱家具生产工厂选择哪家好?年度排行TOP5,精选服务商推荐 - 界川
  • Markmap-tool-service工具使用问题
  • SGMICRO圣邦微 SGM61431XPS8G/TR SOIC-8 DC-DC电源芯片
  • 从凭证到云管理员仅需8分钟:AI加速AWS攻击链
  • SILICON芯科 EFR32MG24A410F1536IM40-B QFN40 无线收发芯片
  • Dify-tool-service工具使用方法
  • 2026年深圳好用的集成空调品牌推荐,解决传统中央空调热能浪费问题 - 工业品牌热点
  • 2026年讯灵AI渠道经理靠谱推荐,全国联络电话别错过 - myqiye
  • 关系数据库替换用金仓:从 Oracle 到 KingbaseES 的迁移实战
  • 造极GEO培训哪家便宜,深度分析高性价比培训机构 - 工业推荐榜
  • 熔点仪哪家口碑好?优质源头厂家实力盘点 - 品牌推荐大师1
  • CVE-2025-31161漏洞利用工具:深入剖析CrushFTP身份验证绕过
  • LITESTAR 4D问答(五):您是否需要将光度和光谱数据保存到一个文件中?
  • 汇川H3U实用程序框架:工程实战与跨品牌借鉴
  • 2026年天津继承律师联系电话推荐:专业团队与联系方式汇总 - 品牌推荐
  • 探寻宁波镇海有实力的律师机构,擅长民事的律所怎么选择 - mypinpai
  • 计算机毕业设计|基于springboot + vue鲜花销售管理系统(源码+数据库+文档)
  • 基于Spring Boot的企业网盘的设计与实现(毕业论文)
  • 深度分析服务不错的团餐供应专业公司,哪家更值得选择 - 工业设备
  • LITESTAR 4D问答(六):您是否需要在几秒内生成光度报告?
  • 实验室废气处理一站式导航:认准派洛普,打造安全智能新空间 - 品牌推荐大师1
  • 哈尔滨木制包装箱定制费用大概多少钱,怎么选择合适的 - 工业品牌热点
  • Gemma 3 270M:专为超高效AI设计的紧凑模型
  • day02