news 2026/4/15 19:56:11

ACPI!ACPIDetectPdoDevices函数中ACPIGetDevicePresenceSync宏定义没有找到_STA方法对象的情况建立了PCI0设备2

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
ACPI!ACPIDetectPdoDevices函数中ACPIGetDevicePresenceSync宏定义没有找到_STA方法对象的情况建立了PCI0设备2

ACPI!ACPIDetectPdoDevices函数中ACPIGetDevicePresenceSync宏定义没有找到_STA方法对象的情况建立了PCI0设备2

//
// Update the current device status
//
status = ACPIGetDevicePresenceSync(
deviceExtension,
(PVOID *) &deviceStatus,
NULL
);

//
// If the device exists
//

if ( NT_SUCCESS(status) &&
!(deviceExtension->Flags & DEV_MASK_NOT_PRESENT) ) {

//
// Is there a match between the device relations and the current
// device extension?
//
matchFound = ACPIDetectPdoMatch(
deviceExtension,
currentRelations
);


BOOLEAN
ACPIDetectPdoMatch(
IN PDEVICE_EXTENSION DeviceExtension,
IN PDEVICE_RELATIONS DeviceRelations
)
{
NTSTATUS status;
PDEVICE_OBJECT devicePdoObject = NULL ;

PAGED_CODE();

//
// For this to work, we must set the DEV_TYPE_NOT_FOUND flag when we
// first create the device and at any time when there is no device object
// associated with the extension
//
if (!(DeviceExtension->Flags & DEV_TYPE_NOT_FOUND) ||
(DeviceExtension->Flags & DEV_PROP_DOCK) ||
DeviceExtension->DeviceObject != NULL) {

return TRUE;

}

//
// deviceObject will be filled in if the extension in question is
// already in the relation. The status will not be successful if the
// extension could not be in the relation.
//
status = ACPIDetectCouldExtensionBeInRelation(
DeviceExtension,
DeviceRelations,
FALSE,
TRUE,
&devicePdoObject
) ;

return (devicePdoObject||(!NT_SUCCESS(status))) ? TRUE : FALSE ;
}


0: kd> t
eax=00000000 ebx=f743b620 ecx=00000000 edx=04b90000 esi=899c0d58 edi=899c0e78
eip=f7440588 esp=f789a214 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!ACPIDetectPdoMatch:
f7440588 55 push ebp
0: kd> kc
#
00 ACPI!ACPIDetectPdoMatch
01 ACPI!ACPIDetectPdoDevices
02 ACPI!ACPIRootIrpQueryBusRelations
03 ACPI!ACPIRootIrpQueryDeviceRelations
04 ACPI!ACPIDispatchIrp
05 nt!IofCallDriver
06 nt!IopSynchronousCall
07 nt!IopQueryDeviceRelations
08 nt!PipEnumerateDevice
09 nt!PipProcessDevNodeTree
0a nt!PipDeviceActionWorker
0b nt!PipRequestDeviceAction
0c nt!IopInitializeBootDrivers
0d nt!IoInitSystem
0e nt!Phase1Initialization
0f nt!PspSystemThreadStartup
10 nt!KiThreadStartup
0: kd> dv
DeviceExtension = 0x899c0d58
DeviceRelations = 0x00000000
devicePdoObject = 0x00000008

//
// Check to see if the relation is non-empty. If it isn't, there isn't
// any work to do. This device obviously could be a Pdo child (as opposed
// to a filter) but it sure isn't at the moment.
//
if (DeviceRelations == NULL || DeviceRelations->Count == 0) {

//
// No match
//
return STATUS_SUCCESS;

}

0: kd> gu
eax=00000000 ebx=f743b620 ecx=00002000 edx=899c0d58 esi=899c0d58 edi=899c0e78
eip=f7400327 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+0x149:
f7400327 84c0 test al,al


if (matchFound == FALSE) {

//
// NOTE: we use this here to prevent having to typecase later
// on
//
matchFound =
(parentExtension->Flags & DEV_TYPE_FDO) ? FALSE : TRUE;

//
// Build a new PDO
//
status = ACPIBuildPdo(
DeviceObject->DriverObject,
deviceExtension,
parentExtension->PhysicalDeviceObject,
matchFound
);


0: kd> t
Breakpoint 9 hit
eax=89981b98 ebx=f743b620 ecx=89981a18 edx=00000000 esi=899c0d58 edi=899c0e78
eip=f73faa3a esp=f789a20c ebp=f789a250 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
ACPI!ACPIBuildPdo:
f73faa3a 55 push ebp
0: kd> kc
#
00 ACPI!ACPIBuildPdo
01 ACPI!ACPIDetectPdoDevices
02 ACPI!ACPIRootIrpQueryBusRelations
03 ACPI!ACPIRootIrpQueryDeviceRelations
04 ACPI!ACPIDispatchIrp
05 nt!IofCallDriver
06 nt!IopSynchronousCall
07 nt!IopQueryDeviceRelations
08 nt!PipEnumerateDevice
09 nt!PipProcessDevNodeTree
0a nt!PipDeviceActionWorker
0b nt!PipRequestDeviceAction
0c nt!IopInitializeBootDrivers
0d nt!IoInitSystem
0e nt!Phase1Initialization
0f nt!PspSystemThreadStartup
10 nt!KiThreadStartup
0: kd> dv
DriverObject = 0x89981f38 Driver "\Driver\ACPI"
DeviceExtension = 0x899c0d58
ParentPdoObject = 0x899c1de0 Device for "\Driver\ACPI_HAL"
CreateAsFilter = 0x00 ''
filterDeviceObject = 0xf73faa3a Device for {...}
newDeviceObject = 0x00000008
oldIrql = 0x89 ''
i = 0
0: kd> !drvobj 0x89981f38
Driver object (89981f38) is for:
\Driver\ACPI

Driver Extension List: (id , addr)

Device Object list:
89981b98


0: kd> dt ACPI!_DEVICE_EXTENSION 0x899c0d58
+0x000 Flags : 0x00402000`02010108
+0x000 UFlags : __unnamed
+0x008 Signature : 0x5f534750
+0x00c DebugFlags : 0
+0x010 DispatchTable : (null)
+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 : 0x899c11d0 "ACPI\PNP0A03"
+0x10c Address : 0x899c11d0
+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 : (null)
+0x134 TargetDeviceObject : (null)
+0x138 PhysicalDeviceObject : (null)
+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> gu
eax=00000000 ebx=f743b620 ecx=00000000 edx=00000000 esi=899c0d58 edi=899c0e78
eip=f7400355 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+0x177:
f7400355 85c0 test eax,eax
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 : 0x899c11d0 "ACPI\PNP0A03"
+0x10c Address : 0x899c11d0
+0x110 InstanceID : (null)
+0x114 ResourceList : (null)
+0x118 PnpResourceList : (null)
+0x11c OutstandingIrpCount : 0n1
+0x120 ReferenceCount : 0n84
+0x124 HibernatePathCount : 0n0
+0x128 RemoveEvent : (null)
+0x12c AcpiObject : 0x899affac _NSObj
+0x130 DeviceObject : 0x899c0f00_DEVICE_OBJECT +0x130 DeviceObject : 0x899c0f00
+0x134 TargetDeviceObject : (null)
+0x138 PhysicalDeviceObject : 0x899c0f00 _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> !drvobj 0x89981f38
Driver object (89981f38) is for:
\Driver\ACPI

Driver Extension List: (id , addr)

Device Object list:
899c0f0089981b98

第二部分:现在的设备树情况:

0: kd> !devnode 0 1
Dumping IopRootDeviceNode (= 0x899c5bc8)
DevNode 0x899c5bc8 for PDO 0x899c5d08
InstancePath is "HTREE\ROOT\0"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
DevNode 0x899c5850 for PDO 0x899c59a8
InstancePath is "Root\ACPI_HAL\0000"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
DevNode 0x899c1008 for PDO 0x899c1de0
InstancePath is "ACPI_HAL\PNP0C08\0"
ServiceName is "ACPI"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeStartPostWork (0x307)
DevNode 0x89986d38 for PDO 0x89986e90
InstancePath is "Root\COMPOSITE_BATTERY\0000"
ServiceName is "Compbatt"
State = DeviceNodeInitialized (0x302)
Previous State = DeviceNodeUninitialized (0x301)

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

AI赋能量化交易:QMT平台的智能开发实战

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 创建一个基于QMT平台的AI辅助量化交易策略开发工具,要求实现以下功能:1. 支持导入股票、期货等金融数据;2. 提供AI驱动的策略建议功能&#xff…

作者头像 李华
网站建设 2026/4/15 12:11:29

DNSMASQ vs传统DNS:性能对比实测报告

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 开发一个DNS性能测试工具,功能包括:1. 并发查询压力测试 2. 缓存命中率统计 3. 响应时间分布分析 4. 资源占用监控 5. 生成对比测试报告。支持测试DNSMASQ/…

作者头像 李华
网站建设 2026/4/15 2:00:01

5行代码实现:Python包管理自动化工具原型

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 用不超过50行代码实现一个简易Python包管理器,功能包括:1)通过命令行参数指定要安装的包;2)自动检查Python和PIP版本;3)支持批量安装…

作者头像 李华
网站建设 2026/4/15 9:28:06

基于Vue的校园共享单车管理系统设计与实现71i72(程序 + 源码 + 数据库 + 调试部署 + 开发环境配置),配套论文文档字数达万字以上,文末可获取,系统界面展示置于文末

系统程序文件列表 系统功能 用户,共享单车,骑行订单,用户充值,骑行记录,费用结算 开题报告内容 基于Vue的校园共享单车管理系统设计与实现开题报告 一、研究背景与意义 1.1 研究背景 随着高校校园规模扩大和师生出行需求增长,共享单车已成为校园内重要的短途交…

作者头像 李华
网站建设 2026/4/15 17:24:50

SEALOS实战:从零搭建高可用Kubernetes集群

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 创建一个详细的SEALOS实战教程,指导用户从零开始搭建一个高可用的Kubernetes集群。教程应包括以下内容:1. 环境准备和依赖安装;2. SEALOS的安装…

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

SM4加密:传统实现与AI生成代码效率对比

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容: 生成两份SM4加密实现代码对比:1) 传统手工编写的优化版本 2) AI生成的版本。要求对两种实现进行详细对比分析,包括代码行数、开发时间、执行效率(使用timei…

作者头像 李华