news 2026/1/8 12:03: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/1/8 12:00:55

Z-Image-Turbo部署架构图解:从前端到后端完整链路

Z-Image-Turbo部署架构图解:从前端到后端完整链路 阿里通义Z-Image-Turbo WebUI图像快速生成模型 二次开发构建by科哥 本文为Z-Image-Turbo WebUI的系统级技术解析,深入剖析其从前端交互、服务调度到模型推理的全链路架构设计。结合实际部署经验与代码实…

作者头像 李华
网站建设 2026/1/8 12:00:03

AI开发者必试:Z-Image-Turbo支持Python脚本批量调用

AI开发者必试:Z-Image-Turbo支持Python脚本批量调用 阿里通义Z-Image-Turbo WebUI图像快速生成模型 二次开发构建by科哥 在AIGC(人工智能生成内容)浪潮席卷设计、广告、游戏等行业的当下,高效、可控的AI图像生成工具已成为开发者…

作者头像 李华
网站建设 2026/1/8 11:58:00

链表拼接.c

#include <stdio.h> #include <stdlib.h> struct ListNode {int data;struct ListNode *next; }; struct ListNode *createlist(); /*裁判实现&#xff0c;细节不表*/ struct ListNode *mergelists(struct ListNode *list1, struct ListNode *list2); void printli…

作者头像 李华
网站建设 2026/1/8 11:56:38

AI如何帮你自动修复DLL错误?免费工具推荐

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容&#xff1a; 开发一个基于AI的DLL修复工具&#xff0c;能够自动扫描系统缺失或损坏的DLL文件&#xff0c;从云端数据库匹配正确的版本并自动下载替换。工具需包含以下功能&#xff1a;1. 智能扫…

作者头像 李华
网站建设 2026/1/8 11:55:32

栅栏密码在CTF竞赛中的实战应用技巧

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容&#xff1a; 开发一个CTF栅栏密码训练工具&#xff0c;模拟常见CTF题目场景。包含多种变种栅栏密码&#xff08;如不规则栅栏、双重栅栏等&#xff09;&#xff0c;提供逐步提示功能&#xff0…

作者头像 李华
网站建设 2026/1/8 11:55:30

地理信息系统集成:将MGeo嵌入现有GIS工作流

地理信息系统集成&#xff1a;将MGeo嵌入现有GIS工作流 城市规划部门经常面临一个挑战&#xff1a;如何在不更换现有GIS系统的情况下&#xff0c;增强地址处理能力。MGeo作为多模态地理语言模型&#xff0c;能够有效解决这一问题。本文将详细介绍如何将MGeo模型无缝集成到现有G…

作者头像 李华