news 2026/6/15 15:18:00

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/6/15 13:05:47

企业级应用:Z-Image-Turbo支撑每日万张图像生成需求

企业级应用:Z-Image-Turbo支撑每日万张图像生成需求 背景与挑战:AI图像生成的规模化落地难题 在内容驱动型企业的运营中,图像资产的生产效率直接决定市场响应速度。传统AI图像生成系统面临三大瓶颈:单次生成耗时长、显存占用高、…

作者头像 李华
网站建设 2026/6/15 15:00:44

Z-Image-Turbo模型结构解析:轻量化的技术实现路径

Z-Image-Turbo模型结构解析:轻量化的技术实现路径 引言:从高效生成到轻量化架构的演进需求 随着AI图像生成技术的普及,用户对生成速度、资源占用和部署便捷性的要求日益提升。传统的扩散模型(如Stable Diffusion)虽然…

作者头像 李华
网站建设 2026/6/15 14:21:36

零售业营销素材自动化:Z-Image-Turbo一周搭建海报生成系统

零售业营销素材自动化:Z-Image-Turbo一周搭建海报生成系统 在零售行业,营销素材的更新频率极高——新品上架、促销活动、节日主题等都需要快速响应。传统设计流程依赖设计师手动制作海报,周期长、成本高,难以满足高频次、小批量的…

作者头像 李华
网站建设 2026/6/15 14:18:10

考虑区域多能源系统集群协同优化的联合需求侧响应模型Matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,擅长数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。 🍎 往期回顾关注个人主页:Matlab科研工作室 👇 关注我领取海量matlab电子书和数学建模资料 &#x1…

作者头像 李华
网站建设 2026/5/29 20:47:10

AI绘画部署教程:阿里通义Z-Image-Turbo镜像快速安装与调优全解析

AI绘画部署教程:阿里通义Z-Image-Turbo镜像快速安装与调优全解析 阿里通义Z-Image-Turbo WebUI图像快速生成模型 二次开发构建by科哥 Z-Image-Turbo 是基于阿里通义实验室最新图像生成技术打造的高性能AI绘画模型,由开发者“科哥”进行深度优化与WebUI集…

作者头像 李华
网站建设 2026/5/30 13:30:09

自媒体配图神器:Z-Image-Turbo一键生成公众号封面实战

自媒体配图神器:Z-Image-Turbo一键生成公众号封面实战 在自媒体内容创作中,一张吸睛的封面图往往决定了文章的点击率和传播效果。然而,专业设计耗时耗力,非美术背景的创作者常常陷入“有好内容却无好配图”的困境。今天&#xff…

作者头像 李华