nt!IopSetupArbiterAndTranslators中的nt!IopQueryResourceHandlerInterface函数分析
0: kd> gu
Breakpoint 7 hit
eax=0000001b ebx=00000000 ecx=89981f38 edx=899c5468 esi=899c5468 edi=899c0f00
eip=f7403f70 esp=f789a0b8 ebp=f789a0d0 iopl=0 nv up ei ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000286
ACPI!ACPIDispatchIrp:
f7403f70 55 push ebp
0: kd> kc
00 ACPI!ACPIDispatchIrp
01 nt!IofCallDriver
02 nt!IopSynchronousCall
03 nt!IopQueryResourceHandlerInterface
04 nt!IopSetupArbiterAndTranslators
05 nt!IopResourceRequirementsListToReqList
06 nt!IopAllocateBootResourcesInternal
07 nt!IopAllocateBootResources
08 nt!IopReportBootResources
09 nt!PiQueryAndAllocateBootResources
0a nt!PiProcessNewDeviceNode
0b nt!PipProcessDevNodeTree
0c nt!PipDeviceActionWorker
0d nt!PipRequestDeviceAction
0e nt!IopInitializeBootDrivers
0f nt!IoInitSystem
10 nt!Phase1Initialization
11 nt!PspSystemThreadStartup
12 nt!KiThreadStartup
0: kd> kv
ChildEBP RetAddr Args to Child
00 f789a0b4 80a2675c 899c0f00 899c5468 899c54fc ACPI!ACPIDispatchIrp (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\busdrv\acpi\driver\nt\dispatch.c @ 575]
01 f789a0d0 80c95e00 00000000 e129d9b8 0000001c nt!IofCallDriver+0x62 (FPO: [Non-Fpo]) (CONV: fastcall) [d:\srv03rtm\base\ntos\io\iomgr\iosubs.c @ 2237]
02 f789a100 80c969ff 00000000 f789a120 00000000 nt!IopSynchronousCall+0x1aa (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpirp.c @ 258]
03 f789a154 80ca137d 00000001 899c0f00 02f78906 nt!IopQueryResourceHandlerInterface+0x10d (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpirp.c @ 1606]
04 f789a198 80ca35be 002be0b8 899c0f00 e12bd008 nt!IopSetupArbiterAndTranslators+0x217 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpres.c @ 2791]
05 f789a214 80ca58bd f789a230 f789a268 00000000 nt!IopResourceRequirementsListToReqList+0x564 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpres.c @ 1715]
06 f789a25c 80ca60ff 00000004 00000000 e12a86e8 nt!IopAllocateBootResourcesInternal+0xaf (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpres.c @ 8061]
07 f789a27c 80e69f35 00000004 899c0f00 e12a86e8 nt!IopAllocateBootResources+0xb1 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpres.c @ 7749]
08 f789a2a0 80c90b8f 00000004 899c0f00 e12a86e8 nt!IopReportBootResources+0x63 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpres.c @ 7813]
09 f789a2d0 80c945dc 899875a8 800000ec 00000001 nt!PiQueryAndAllocateBootResources+0x1c5 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpenum.c @ 1481]
0a f789a38c 80c94ce9 009875a8 00000000 00000000 nt!PiProcessNewDeviceNode+0xd5a (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpenum.c @ 2037]
0b f789a5d4 80a2dde9 899c5bc8 00000000 89987300 nt!PipProcessDevNodeTree+0x15b (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpenum.c @ 4606]
0c f789a618 80a2e161 00000000 00000000 800836b0 nt!PipDeviceActionWorker+0xcd (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpenum.c @ 710]
0d f789a630 80e69358 00000000 00000005 00000000 nt!PipRequestDeviceAction+0x139 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpenum.c @ 598]
0e f789a694 80e655c7 80077000 f789a7dc 00034000 nt!IopInitializeBootDrivers+0x392 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\pnpmgr\pnpinit.c @ 1440]
0f f789a838 80e632fd 80077000 00000000 899a1020 nt!IoInitSystem+0x70b (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\io\iomgr\ioinit.c @ 665]
10 f789adac 80d391f0 80077000 00000000 00000000 nt!Phase1Initialization+0x9b3 (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\init\init.c @ 2221]
11 f789addc 80b00d52 80e6294a 80077000 00000000 nt!PspSystemThreadStartup+0x2e (FPO: [Non-Fpo]) (CONV: stdcall) [d:\srv03rtm\base\ntos\ps\create.c @ 2213]
12 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16 [d:\srv03rtm\base\ntos\ke\i386\threadbg.asm @ 81]
0: kd> dv
DeviceObject = 0x899c0f00 Device for "\Driver\ACPI"
Irp = 0x899c5468
removeEvent = struct _KEVENT
dispatchTable = 0xf7403f71
deviceExtension = 0x00000008
0: kd> !Irp 0x899c5468
Irp is active with 1 stacks 1 is current (= 0x899c54d8)
No Mdl: No System Buffer: Thread 899a1020: Irp stack trace.
cmd flg cl Device File Completion-Context
>[IRP_MJ_PNP(1b), IRP_MN_QUERY_INTERFACE(8)]
0 0 899c0f00 00000000 00000000-00000000
\Driver\ACPI
Args: f789a144 0000001c e129d9b8 00000006
0: kd> kc
00 ACPI!ACPIBusIrpQueryInterface
01 ACPI!ACPIDispatchIrp
02 nt!IofCallDriver
03 nt!IopSynchronousCall
04 nt!IopQueryResourceHandlerInterface
05 nt!IopSetupArbiterAndTranslators
06 nt!IopResourceRequirementsListToReqList
07 nt!IopAllocateBootResourcesInternal
08 nt!IopAllocateBootResources
09 nt!IopReportBootResources
0a nt!PiQueryAndAllocateBootResources
0b nt!PiProcessNewDeviceNode
0c nt!PipProcessDevNodeTree
0d nt!PipDeviceActionWorker
0e nt!PipRequestDeviceAction
0f nt!IopInitializeBootDrivers
10 nt!IoInitSystem
11 nt!Phase1Initialization
12 nt!PspSystemThreadStartup
13 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x899c0f00 Device for "\Driver\ACPI"
Irp = 0x899c5468
status = 0n8
PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation( Irp );
ULONG count;
resource = (CM_RESOURCE_TYPE)
PtrToUlong(irpStack->Parameters.QueryInterface.InterfaceSpecificData);
interfaceType = (LPGUID) irpStack->Parameters.QueryInterface.InterfaceType;
0: kd> dd 0x899c5468
899c5468 00940006 00000000 00000000 00000000
899c5478 899a1238 899a1238 c00000bb 00000000
899c5488 01010000 04000000 f789a0f4 f789a0e4
899c5498 00000000 00000000 00000000 00000000
899c54a8 00000000 00000000 00000000 00000000
899c54b8 899a1020 00000000 00000000 00000000
899c54c8 899c54d8 00000000 00000000 00000000 899c54d8
899c54d8 0000081b f789a144 0000001c e129d9b8
0: kd> dt IO_STACK_LOCATION 899c54d8 -r
nt!IO_STACK_LOCATION
+0x000 MajorFunction : 0x1b ''
+0x001 MinorFunction : 0x8 ''
+0x002 Flags : 0 ''
+0x003 Control : 0 ''
+0x004 Parameters : __unnamed
+0x000 QueryInterface : __unnamed
+0x000 InterfaceType : 0xf789a144 _GUID {6c154a92-aacf-11d0-8d2a-00a0c906b244}
+0x004 Size : 0x1c
+0x006 Version : 0
+0x008 Interface : 0xe129d9b8 _INTERFACE
+0x00c InterfaceSpecificData : 0x00000006 Void
0: kd> dv resource
resource = 0n8
status2 = RtlStringFromGUID( interfaceType, &guidString );
0: kd> t
eax=f789a06c ebx=f789a144 ecx=00000000 edx=00000000 esi=00000006 edi=899c54d8
eip=80d66436 esp=f789a054 ebp=f789a080 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
nt!RtlStringFromGUID:
80d66436 55 push ebp
0: kd> dv
Guid = 0xf789a144 {6C154A92-AACF-11D0-8D2A-00A0C906B244}
GuidString = 0xf789a06c ""
0: kd> gu
eax=00000000 ebx=f789a144 ecx=0000007d edx=e127a942 esi=00000006 edi=899c54d8
eip=f743f096 esp=f789a060 ebp=f789a080 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!ACPIBusIrpQueryInterface+0x6a:
f743f096 85c0 test eax,eax
0: kd> dx -r1 ((ntkrnlmp!_UNICODE_STRING *)0xf789a06c)
((ntkrnlmp!_UNICODE_STRING *)0xf789a06c) : 0xf789a06c : "{6c154a92-aacf-11d0-8d2a-00a0c906b244}" [Type: _UNICODE_STRING *]
\
0: kd> dx -r1 -nv (*((ntkrnlmp!_UNICODE_STRING *)0xf789a06c))
(*((ntkrnlmp!_UNICODE_STRING *)0xf789a06c)) : "{6c154a92-aacf-11d0-8d2a-00a0c906b244}" [Type: _UNICODE_STRING]
+0x000\] Length : 0x4c \[Type: unsigned short
+0x002\] MaximumLength : 0x4e \[Type: unsigned short
+0x004\] Buffer : 0xe127a8f8 : 0x7b \[Type: unsigned short \*
0: kd> db 0xe127a8f8
e127a8f8 7b 00 36 00 63 00 31 00-35 00 34 00 61 00 39 00 {.6.c.1.5.4.a.9.
e127a908 32 00 2d 00 61 00 61 00-63 00 66 00 2d 00 31 00 2.-.a.a.c.f.-.1.
e127a918 31 00 64 00 30 00 2d 00-38 00 64 00 32 00 61 00 1.d.0.-.8.d.2.a.
e127a928 2d 00 30 00 30 00 61 00-30 00 63 00 39 00 30 00 -.0.0.a.0.c.9.0.
e127a938 36 00 62 00 32 00 34 00-34 00 7d 00 00 00 b2 b2 6.b.2.4.4.}.....
GUID_ACPI_INTERFACE_STANDARD
GUID_TRANSLATOR_INTERFACE_STANDARD
GUID_PCI_BUS_INTERFACE_STANDARD
GUID_BUS_INTERFACE_STANDARD
DEFINE_GUID( GUID_TRANSLATOR_INTERFACE_STANDARD, 0x6c154a92L, 0xaacf, 0x11d0, 0x8d, 0x2a, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44 );
DEFINE_GUID( GUID_ACPI_INTERFACE_STANDARD, 0xb091a08aL, 0xba97, 0x11d0, 0xbd, 0x14, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a );
DEFINE_GUID( GUID_PCI_BUS_INTERFACE_STANDARD, 0x496B8281L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F );
DEFINE_GUID( GUID_BUS_INTERFACE_STANDARD, 0x496B8280L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F );
D:\srv03rtm\base\busdrv>grep "GUID_ACPI_INTERFACE_STANDARD" -nr D:\srv03rtm\public\sdk\inc
D:\srv03rtm\public\sdk\inc/wdmguid.h:49:DEFINE_GUID( GUID_ACPI_INTERFACE_STANDARD, 0xb091a08aL, 0xba97, 0x11d0, 0xbd, 0x14, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a );
GUID_TRANSLATOR_INTERFACE_STANDARD
// CmResourceTypeNull is reserved
#define CmResourceTypeNull 0 // ResType_All or ResType_None (0x0000)
#define CmResourceTypePort 1 // ResType_IO (0x0002)
#define CmResourceTypeInterrupt 2 // ResType_IRQ (0x0004)
#define CmResourceTypeMemory 3 // ResType_Mem (0x0001)
#define CmResourceTypeDma 4 // ResType_DMA (0x0003)
#define CmResourceTypeDeviceSpecific 5 // ResType_ClassSpecific (0xFFFF)
#define CmResourceTypeBusNumber 6 // ResType_BusNumber (0x0006)
0: kd> dv
DeviceObject = 0x899c0f00 Device for "\Driver\ACPI"
Irp = 0x899c5468
status = 0n-1073741637
resource = 0n6
} else if (CompareGuid(interfaceType, (PVOID) &GUID_TRANSLATOR_INTERFACE_STANDARD)) {
if (resource == CmResourceTypeInterrupt) {
} else if ((resource == CmResourceTypePort) || (resource == CmResourceTypeMemory)) {
}
没有,不需要操作。
0: kd> dx -r1 -nv (*((ACPI!_IRP *)0x899c5468))
(*((ACPI!_IRP *)0x899c5468)) [Type: _IRP]
+0x000\] Type : 0 \[Type: short
+0x002\] Size : 0x0 \[Type: unsigned short
+0x004\] MdlAddress : 0x0 \[Type: _MDL \*
+0x008\] Flags : 0x0 \[Type: unsigned long
+0x00c\] AssociatedIrp \[Type: __unnamed
+0x010\] ThreadListEntry \[Type: _LIST_ENTRY
+0x018\] IoStatus \[Type: _IO_STATUS_BLOCK
+0x020\] RequestorMode : 0 \[Type: char
+0x021\] PendingReturned : 0x0 \[Type: unsigned char
+0x022\] StackCount : 1 \[Type: char
+0x023\] CurrentLocation : 3 \[Type: char
+0x024\] Cancel : 0x0 \[Type: unsigned char
+0x025\] CancelIrql : 0x0 \[Type: unsigned char
+0x026\] ApcEnvironment : 0 \[Type: char
+0x027\] AllocationFlags : 0x4 \[Type: unsigned char
+0x028\] UserIosb : 0xf789a0f4 \[Type: _IO_STATUS_BLOCK \*
+0x02c\] UserEvent : 0xf789a0e4 \[Type: _KEVENT \*
+0x030\] Overlay \[Type: __unnamed
+0x038\] CancelRoutine : 0x0 \[Type: void (\*)(_DEVICE_OBJECT \*,_IRP \*)
+0x03c\] UserBuffer : 0x0 \[Type: void \*
+0x040\] Tail \[Type: __unnamed
0: kd> dx -r1 (*((ACPI!_IO_STATUS_BLOCK *)0x899c5480))
(*((ACPI!_IO_STATUS_BLOCK *)0x899c5480)) [Type: _IO_STATUS_BLOCK]
+0x000\] Status : -1073741637 \[Type: long
+0x000\] Pointer : 0xc00000bb \[Type: void \*
+0x004\] Information : 0x94 \[Type: unsigned long
0: kd> ?-0n1073741637
Evaluate expression: -1073741637 = c00000bb
0: kd> p
eax=c00000bb ebx=899c5408 ecx=00000000 edx=00000000 esi=f743f02c edi=00000000
eip=f743f17b esp=f789a06c ebp=f789a080 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!ACPIBusIrpQueryInterface+0x14f:
f743f17b c9 leave
0: kd> pr
0: kd> gu
eax=c00000bb ebx=00000000 ecx=899c0e74 edx=00000000 esi=899c5468 edi=899c0f00
eip=80a2675c esp=f789a0c4 ebp=f789a0d0 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
nt!IofCallDriver+0x62:
80a2675c 5f pop edi
0: kd> gu
eax=c00000bb ebx=899c0f00 ecx=899c0e74 edx=00000000 esi=f789a144 edi=899c54fc
eip=80c95e00 esp=f789a0d8 ebp=f789a100 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
nt!IopSynchronousCall+0x1aa:
80c95e00 8bf0 mov esi,eax
0: kd> gu
eax=c00000bb ebx=0000001c ecx=00000008 edx=00000000 esi=e129d9b8 edi=00000000
eip=80c969ff esp=f789a114 ebp=f789a154 iopl=0 nv up ei ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000286
nt!IopQueryResourceHandlerInterface+0x10d:
80c969ff 8bd8 mov ebx,eax
NTSTATUS
IopQueryResourceHandlerInterface(
IN RESOURCE_HANDLER_TYPE HandlerType,
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR ResourceType,
IN OUT PVOID *Interface
)
{
irpSp.MajorFunction = IRP_MJ_PNP;
irpSp.MinorFunction = IRP_MN_QUERY_INTERFACE;
//
// Set the pointer to the resource list
//
irpSp.Parameters.QueryInterface.InterfaceType = &interfaceType;
irpSp.Parameters.QueryInterface.Size = interface->Size;
irpSp.Parameters.QueryInterface.Version = interface->Version = 0;
irpSp.Parameters.QueryInterface.Interface = interface;
irpSp.Parameters.QueryInterface.InterfaceSpecificData = (PVOID) (ULONG_PTR) ResourceType;
//
// Make the call and return.
//
status = IopSynchronousCall(DeviceObject, &irpSp, NULL); 返回到这里:
if (NT_SUCCESS(status)) {
0: kd> p
eax=c00000bb ebx=e12be0b8 ecx=00140001 edx=00130000 esi=00000040 edi=899875a8
eip=80c96aed esp=f789a120 ebp=f789a154 iopl=0 nv up ei pl zr na pe cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000247
nt!IopQueryResourceHandlerInterface+0x1fb:
80c96aed c9 leave
0: kd> gu
eax=c00000bb ebx=e12be0b8 ecx=00140001 edx=00130000 esi=00000040 edi=899875a8
eip=80ca137d esp=f789a16c ebp=f789a198 iopl=0 nv up ei pl zr na pe cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000247
nt!IopSetupArbiterAndTranslators+0x217:
80ca137d 6609b7da000000 or word ptr [edi+0DAh],si ds:0023:89987682=0000
NTSTATUS
IopSetupArbiterAndTranslators(
IN PREQ_DESC ReqDesc
)
{
status = IopQueryResourceHandlerInterface(ResourceTranslator,
deviceNode->PhysicalDeviceObject,
resourceType,
&interface);
deviceNode->QueryTranslatorMask |= resourceMask;
while (deviceNode) {
if ((deviceNode == IopRootDeviceNode) && (translatorFound == FALSE)) {
//
// If we reach the root and have not find any translator, the device is on the
// wrong way.
//
0: kd> p
eax=00000000 ebx=e12be0b8 ecx=00140001 edx=00130000 esi=899c0f00 edi=899c1008
eip=80ca11c6 esp=f789a16c ebp=f789a198 iopl=0 nv up ei ng nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000282
nt!IopSetupArbiterAndTranslators+0x60:
80ca11c6 3b3d00f7b180 cmp edi,dword ptr [nt!IopRootDeviceNode (80b1f700)] ds:0023:80b1f700=899c5bc8
0: kd> p
0: kd> x nt!IopRootDeviceNode
80b1f700 nt!IopRootDeviceNode = 0x899c5bc8
0: kd> !devnode 899c1008
DevNode 0x899c1008 for PDO 0x899c1de0
Parent 0x899c5850 Sibling 0000000000 Child 0x899875a8
InstancePath is "ACPI_HAL\PNP0C08\0"
ServiceName is "ACPI"
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[07] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[06] = DeviceNodeStarted (0x308)
StateHistory[05] = DeviceNodeStartPostWork (0x307)
StateHistory[04] = DeviceNodeStartCompletion (0x306)
StateHistory[03] = DeviceNodeResourcesAssigned (0x304)
StateHistory[02] = DeviceNodeDriversAdded (0x303)
StateHistory[01] = DeviceNodeInitialized (0x302)
StateHistory[00] = DeviceNodeUninitialized (0x301)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x0)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
StateHistory[12] = Unknown State (0x0)
StateHistory[11] = Unknown State (0x0)
StateHistory[10] = Unknown State (0x0)
StateHistory[09] = Unknown State (0x0)
StateHistory[08] = Unknown State (0x0)
Flags (0x000000f0) DNF_ENUMERATED, DNF_IDS_QUERIED,
DNF_HAS_BOOT_CONFIG, DNF_BOOT_CONFIG_RESERVED
CapabilityFlags (0x000000c0) UniqueID, SilentInstall
if ((arbiterFound == FALSE) && (deviceNode->PhysicalDeviceObject != deviceObject)) {
found = IopFindResourceHandlerInfo(
ResourceArbiter,
deviceNode,
resourceType,
&arbiterEntry);
0: kd> kc
00 nt!IopFindResourceHandlerInfo
01 nt!IopSetupArbiterAndTranslators
02 nt!IopResourceRequirementsListToReqList
03 nt!IopAllocateBootResourcesInternal
04 nt!IopAllocateBootResources
05 nt!IopReportBootResources
06 nt!PiQueryAndAllocateBootResources
07 nt!PiProcessNewDeviceNode
08 nt!PipProcessDevNodeTree
09 nt!PipDeviceActionWorker
0a nt!PipRequestDeviceAction
0b nt!IopInitializeBootDrivers
0c nt!IoInitSystem
0d nt!Phase1Initialization
0e nt!PspSystemThreadStartup
0f nt!KiThreadStartup
0: kd> dv
HandlerType = ResourceArbiter (0n2)
DeviceNode = 0x899c1008
ResourceType = 0x06 ''
0: kd> dx -r1 ((ntkrnlmp!_DEVICE_NODE *)0x899c1008)
((ntkrnlmp!_DEVICE_NODE *)0x899c1008) : 0x899c1008 [Type: _DEVICE_NODE *]
+0x000\] Sibling : 0x0 \[Type: _DEVICE_NODE \*
+0x004\] Child : 0x899875a8 \[Type: _DEVICE_NODE \*
+0x008\] Parent : 0x899c5850 \[Type: _DEVICE_NODE \*
+0x00c\] LastChild : 0x899ae580 \[Type: _DEVICE_NODE \*
+0x010\] Level : 0x2 \[Type: unsigned long
+0x014\] Notify : 0x0 \[Type: _PO_DEVICE_NOTIFY \*
+0x018\] State : DeviceNodeStarted (776) \[Type: _PNP_DEVNODE_STATE
+0x01c\] PreviousState : DeviceNodeEnumerateCompletion (781) \[Type: _PNP_DEVNODE_STATE
+0x020\] StateHistory \[Type: _PNP_DEVNODE_STATE \[20\]
+0x070\] StateHistoryEntry : 0x8 \[Type: unsigned long
+0x074\] CompletionStatus : 0 \[Type: long
+0x078\] PendingIrp : 0x0 \[Type: _IRP \*
+0x07c\] Flags : 0xf0 \[Type: unsigned long
+0x080\] UserFlags : 0x0 \[Type: unsigned long
+0x084\] Problem : 0x0 \[Type: unsigned long
+0x088\] PhysicalDeviceObject : 0x899c1de0 : Device for "\\Driver\\ACPI_HAL" \[Type: _DEVICE_OBJECT \*
+0x08c\] ResourceList : 0xe127b758 \[Type: _CM_RESOURCE_LIST \*
+0x090\] ResourceListTranslated : 0xe127fe58 \[Type: _CM_RESOURCE_LIST \*
+0x094\] InstancePath : "ACPI_HAL\\PNP0C08\\0" \[Type: _UNICODE_STRING
+0x09c\] ServiceName : "ACPI" \[Type: _UNICODE_STRING
+0x0a4\] DuplicatePDO : 0x0 \[Type: _DEVICE_OBJECT \*
+0x0a8\] ResourceRequirements : 0xe1287ce8 \[Type: _IO_RESOURCE_REQUIREMENTS_LIST \*
+0x0ac\] InterfaceType : InterfaceTypeUndefined (-1) \[Type: _INTERFACE_TYPE
+0x0b0\] BusNumber : 0xfffffff0 \[Type: unsigned long
+0x0b4\] ChildInterfaceType : InterfaceTypeUndefined (-1) \[Type: _INTERFACE_TYPE
+0x0b8\] ChildBusNumber : 0xfffffff0 \[Type: unsigned long
+0x0bc\] ChildBusTypeIndex : 0xffff \[Type: unsigned short
+0x0be\] RemovalPolicy : 0x1 \[Type: unsigned char
+0x0bf\] HardwareRemovalPolicy : 0x1 \[Type: unsigned char
+0x0c0\] TargetDeviceNotify \[Type: _LIST_ENTRY
+0x0c8\] DeviceArbiterList \[Type: _LIST_ENTRY
+0x0dc\] NoArbiterMask : 0x0 \[Type: unsigned short
+0x0de\] QueryArbiterMask : 0x0 \[Type: unsigned short
0: kd> dx -r1 (*((ntkrnlmp!_LIST_ENTRY *)0x899c10d0))
(*((ntkrnlmp!_LIST_ENTRY *)0x899c10d0)) [Type: _LIST_ENTRY]
+0x000\] Flink : 0x899c10d0 \[Type: _LIST_ENTRY \*
+0x004\] Blink : 0x899c10d0 \[Type: _LIST_ENTRY \*
switch (HandlerType) {
case ResourceArbiter:
noHandlerMask = DeviceNode->NoArbiterMask;
queryHandlerMask = DeviceNode->QueryArbiterMask;
listHead = &DeviceNode->DeviceArbiterList;
break;
if ((arbiterFound == FALSE) && (deviceNode->PhysicalDeviceObject != deviceObject)) {
found = IopFindResourceHandlerInfo(
ResourceArbiter,
deviceNode,
resourceType,
&arbiterEntry);
if (found == FALSE) {
//
// no information found on arbiter. Try to query translator interface ...
//
if (resourceType <= PI_MAXIMUM_RESOURCE_TYPE_TRACKED) {
resourceMask = 1 << resourceType;
} else {
resourceMask = 0;
}
status = IopQueryResourceHandlerInterface(ResourceArbiter,
deviceNode->PhysicalDeviceObject,
resourceType,
&interface);
0: kd> kc
00 nt!IopQueryResourceHandlerInterface
01 nt!IopSetupArbiterAndTranslators
02 nt!IopResourceRequirementsListToReqList
03 nt!IopAllocateBootResourcesInternal
04 nt!IopAllocateBootResources
05 nt!IopReportBootResources
06 nt!PiQueryAndAllocateBootResources
07 nt!PiProcessNewDeviceNode
08 nt!PipProcessDevNodeTree
09 nt!PipDeviceActionWorker
0a nt!PipRequestDeviceAction
0b nt!IopInitializeBootDrivers
0c nt!IoInitSystem
0d nt!Phase1Initialization
0e nt!PspSystemThreadStartup
0f nt!KiThreadStartup
0: kd> dv
HandlerType = ResourceArbiter (0n2)
DeviceObject = 0x899c1de0 Device for "\Driver\ACPI_HAL"
ResourceType = 0x06 ''
case ResourceArbiter:
size = sizeof(ARBITER_INTERFACE);
interfaceType = GUID_ARBITER_INTERFACE_STANDARD;
break;
0: kd>
Breakpoint 7 hit
eax=0000001b ebx=00000000 ecx=89981f38 edx=899bf5b0 esi=899bf5b0 edi=89981b98
eip=f7403f70 esp=f789a0b8 ebp=f789a0d0 iopl=0 nv up ei ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000286
ACPI!ACPIDispatchIrp:
f7403f70 55 push ebp
0: kd> kc
00 ACPI!ACPIDispatchIrp
01 nt!IofCallDriver
02 nt!IopSynchronousCall
03 nt!IopQueryResourceHandlerInterface
04 nt!IopSetupArbiterAndTranslators
05 nt!IopResourceRequirementsListToReqList
06 nt!IopAllocateBootResourcesInternal
07 nt!IopAllocateBootResources
08 nt!IopReportBootResources
09 nt!PiQueryAndAllocateBootResources
0a nt!PiProcessNewDeviceNode
0b nt!PipProcessDevNodeTree
0c nt!PipDeviceActionWorker
0d nt!PipRequestDeviceAction
0e nt!IopInitializeBootDrivers
0f nt!IoInitSystem
10 nt!Phase1Initialization
11 nt!PspSystemThreadStartup
12 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x89981b98 Device for "\Driver\ACPI"
Irp = 0x899bf5b0
removeEvent = struct _KEVENT
dispatchTable = 0xf7403f71
deviceExtension = 0x00000008
0: kd> !Irp 0x899bf5b0
Irp is active with 2 stacks 2 is current (= 0x899bf644)
No Mdl: No System Buffer: Thread 899a1020: Irp stack trace.
cmd flg cl Device File Completion-Context
N/A(0), N/A(0)
0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
>[IRP_MJ_PNP(1b), IRP_MN_QUERY_INTERFACE(8)]
0 0 89981b98 00000000 00000000-00000000
\Driver\ACPI
Args: f789a144 0000001c e129d9b8 00000006
0: kd> kc
00 ACPI!ACPIRootIrpQueryInterface
01 ACPI!ACPIDispatchIrp
02 nt!IofCallDriver
03 nt!IopSynchronousCall
04 nt!IopQueryResourceHandlerInterface
05 nt!IopSetupArbiterAndTranslators
06 nt!IopResourceRequirementsListToReqList
07 nt!IopAllocateBootResourcesInternal
08 nt!IopAllocateBootResources
09 nt!IopReportBootResources
0a nt!PiQueryAndAllocateBootResources
0b nt!PiProcessNewDeviceNode
0c nt!PipProcessDevNodeTree
0d nt!PipDeviceActionWorker
0e nt!PipRequestDeviceAction
0f nt!IopInitializeBootDrivers
10 nt!IoInitSystem
11 nt!Phase1Initialization
12 nt!PspSystemThreadStartup
13 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x89981b98 Device for "\Driver\ACPI"
Irp = 0x899bf5b0
ArbiterTable = struct _ARBITER_INTERFACE
resource = 0n-1986267728
0: kd> dd 0x899bf5b0
899bf5b0 01900006 00000000 00000000 00000000
899bf5c0 899a1238 899a1238 c00000bb 00000000
899bf5d0 02020000 04000000 f789a0f4 f789a0e4
899bf5e0 00000000 00000000 00000000 00000000
899bf5f0 00000000 00000000 00000000 00000000
899bf600 899a1020 00000000 00000000 00000000
899bf610 899bf644 00000000 00000000 00000000
899bf620 00000000 00000000 00000000 00000000
0: kd> dt IO_STACK_LOCATION 899bf644
nt!IO_STACK_LOCATION
+0x000 MajorFunction : 0x1b ''
+0x001 MinorFunction : 0x8 ''
+0x002 Flags : 0 ''
+0x003 Control : 0 ''
+0x004 Parameters : __unnamed
+0x014 DeviceObject : 0x89981b98 _DEVICE_OBJECT
+0x018 FileObject : (null)
+0x01c CompletionRoutine : (null)
+0x020 Context : (null)
0: kd> dt IO_STACK_LOCATION 899bf644 -r
nt!IO_STACK_LOCATION
+0x000 MajorFunction : 0x1b ''
+0x001 MinorFunction : 0x8 ''
+0x002 Flags : 0 ''
+0x003 Control : 0 ''
+0x004 Parameters : __unnamed
+0x000 QueryInterface : __unnamed
+0x000 InterfaceType : 0xf789a144 _GUID {6c154a92-aacf-11d0-8d2a-00a0c906b244}
+0x004 Size : 0x1c
+0x006 Version : 0
+0x008 Interface : 0xe129d9b8 _INTERFACE
+0x00c InterfaceSpecificData : 0x00000006 Void
看看:
ArbiterTable.ArbiterHandler = &ArbArbiterHandler;
ACPI!ArbArbiterHandler
看看:
DEFINE_GUID( GUID_ARBITER_INTERFACE_STANDARD, 0xe644f185L, 0x8c0e, 0x11d0, 0xbe, 0xcf, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f );
return ACPIDispatchForwardIrp( DeviceObject, Irp );
}
deviceExtension = ACPIInternalGetDeviceExtension(DeviceObject);
if (deviceExtension->TargetDeviceObject) {
//
// Forward to target device
//
IoSkipCurrentIrpStackLocation (Irp);
status = IoCallDriver (deviceExtension->TargetDeviceObject, Irp);
0: kd> kc
00 hal!HalpDispatchPnp
01 nt!IofCallDriver
02 ACPI!ACPIDispatchForwardIrp
03 ACPI!ACPIRootIrpQueryInterface
04 ACPI!ACPIDispatchIrp
05 nt!IofCallDriver
06 nt!IopSynchronousCall
07 nt!IopQueryResourceHandlerInterface
08 nt!IopSetupArbiterAndTranslators
09 nt!IopResourceRequirementsListToReqList
0a nt!IopAllocateBootResourcesInternal
0b nt!IopAllocateBootResources
0c nt!IopReportBootResources
0d nt!PiQueryAndAllocateBootResources
0e nt!PiProcessNewDeviceNode
0f nt!PipProcessDevNodeTree
10 nt!PipDeviceActionWorker
11 nt!PipRequestDeviceAction
12 nt!IopInitializeBootDrivers
13 nt!IoInitSystem
14 nt!Phase1Initialization
15 nt!PspSystemThreadStartup
16 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x899c1de0 Device for "\Driver\ACPI_HAL"
Irp = 0x899bf5b0
0: kd> !Irp 0x899bf5b0
Irp is active with 2 stacks 2 is current (= 0x899bf644)
No Mdl: No System Buffer: Thread 899a1020: Irp stack trace.
cmd flg cl Device File Completion-Context
N/A(0), N/A(0)
0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
>[IRP_MJ_PNP(1b), IRP_MN_QUERY_INTERFACE(8)]
0 0 899c1de0 00000000 00000000-00000000
\Driver\ACPI_HAL
Args: f789a144 0000001c e129d9b8 00000006
case IRP_MN_QUERY_INTERFACE:
HalPrint(("HAL: (%s) Query_Interface Irp received\n",
objectTypeString));
status = HalpQueryInterface(
DeviceObject,
irpSp->Parameters.QueryInterface.InterfaceType,
irpSp->Parameters.QueryInterface.Version,
irpSp->Parameters.QueryInterface.InterfaceSpecificData,
irpSp->Parameters.QueryInterface.Size,
irpSp->Parameters.QueryInterface.Interface,
&Irp->IoStatus.Information
);
break;
0: kd> kc
00 hal!HalpQueryInterface
01 hal!HalpDispatchPnp
02 nt!IofCallDriver
03 ACPI!ACPIDispatchForwardIrp
04 ACPI!ACPIRootIrpQueryInterface
05 ACPI!ACPIDispatchIrp
06 nt!IofCallDriver
07 nt!IopSynchronousCall
08 nt!IopQueryResourceHandlerInterface
09 nt!IopSetupArbiterAndTranslators
0a nt!IopResourceRequirementsListToReqList
0b nt!IopAllocateBootResourcesInternal
0c nt!IopAllocateBootResources
0d nt!IopReportBootResources
0e nt!PiQueryAndAllocateBootResources
0f nt!PiProcessNewDeviceNode
10 nt!PipProcessDevNodeTree
11 nt!PipDeviceActionWorker
12 nt!PipRequestDeviceAction
13 nt!IopInitializeBootDrivers
14 nt!IoInitSystem
15 nt!Phase1Initialization
16 nt!PspSystemThreadStartup
17 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x899c1de0 Device for "\Driver\ACPI_HAL"
InterfaceType = 0xf789a144 {6C154A92-AACF-11D0-8D2A-00A0C906B244}
Version = 0
InterfaceSpecificData = 0x00000006
InterfaceBufferSize = 0x1c
Interface = 0xe129d9b8
Length = 0x899bf5cc
DEFINE_GUID( GUID_TRANSLATOR_INTERFACE_STANDARD, 0x6c154a92L, 0xaacf, 0x11d0, 0x8d, 0x2a, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44 );
switch ((CM_RESOURCE_TYPE)PtrToUlong(InterfaceSpecificData)) {
case CmResourceTypeInterrupt:
translator->Size = sizeof(TRANSLATOR_INTERFACE);
translator->Version = HAL_IRQ_TRANSLATOR_VERSION;
translator->Context = DeviceObject;
translator->InterfaceReference = HalTranslatorReference;
translator->InterfaceDereference = HalTranslatorDereference;
translator->TranslateResources = HalIrqTranslateResourcesRoot;
translator->TranslateResourceRequirements =
HalIrqTranslateResourceRequirementsRoot;
*Length = sizeof(TRANSLATOR_INTERFACE);
break;
default:
return STATUS_NOT_SUPPORTED ;
}
0: kd> p
eax=c00000bb ebx=899bf5b0 ecx=00000018 edx=899bf5b0 esi=899bf644 edi=899c1de0
eip=8050b7c1 esp=f7899fe4 ebp=f7899fe4 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
hal!HalpQueryInterface+0x69:
8050b7c1 5d pop ebp
0: kd> gu
eax=c00000bb ebx=899bf5b0 ecx=00000018 edx=899bf5b0 esi=899bf644 edi=899c1de0
eip=8050c201 esp=f789a008 ebp=f789a014 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
hal!HalpDispatchPnp+0x5bd:
8050c201 8bf8 mov edi,eax
0: kd> gu
eax=c00000bb ebx=00000000 ecx=00000000 edx=00000000 esi=899bf5b0 edi=899c1de0
eip=80a2675c esp=f789a024 ebp=f789a030 iopl=0 nv up ei pl zr na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000246
nt!IofCallDriver+0x62:
80a2675c 5f pop edi
0: kd> gu
eax=c00000bb ebx=899bf5b0 ecx=00000000 edx=00000000 esi=f789a144 edi=899bf644
eip=f7403380 esp=f789a038 ebp=f789a03c 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!ACPIDispatchForwardIrp+0x28:
f7403380 8bf8 mov edi,eax
0: kd> gu
eax=c00000bb ebx=899bf5b0 ecx=00000000 edx=00000000 esi=f789a144 edi=899bf644
eip=f744f174 esp=f789a04c ebp=f789a080 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!ACPIRootIrpQueryInterface+0x142:
f744f174 5f pop edi
0: kd> gu
eax=c00000bb ebx=899bf508 ecx=00000000 edx=00000000 esi=f744f032 edi=00000000
eip=f740410e esp=f789a090 ebp=f789a0b4 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!ACPIDispatchIrp+0x19e:
f740410e ff75fc push dword ptr [ebp-4] ss:0010:f789a0b0=89981a18
0: kd> gu
eax=c00000bb ebx=00000000 ecx=89981b34 edx=00000000 esi=899bf5b0 edi=89981b98
eip=80a2675c esp=f789a0c4 ebp=f789a0d0 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
nt!IofCallDriver+0x62:
80a2675c 5f pop edi
0: kd> gu
eax=c00000bb ebx=89981b98 ecx=89981b34 edx=00000000 esi=f789a144 edi=899bf668
eip=80c95e00 esp=f789a0d8 ebp=f789a100 iopl=0 nv up ei pl nz na po nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000202
nt!IopSynchronousCall+0x1aa:
80c95e00 8bf0 mov esi,eax
0: kd> gu
eax=c00000bb ebx=0000001c ecx=00000008 edx=00000000 esi=e129d9b8 edi=00000000
eip=80c969ff esp=f789a114 ebp=f789a154 iopl=0 nv up ei ng nz na pe nc
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000286
nt!IopQueryResourceHandlerInterface+0x10d:
80c969ff 8bd8 mov ebx,eax
0: kd> gu
eax=c00000bb ebx=e12be0b8 ecx=00150001 edx=00140000 esi=00000040 edi=899c1008
eip=80ca137d esp=f789a16c ebp=f789a198 iopl=0 nv up ei pl zr na po cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000243
nt!IopSetupArbiterAndTranslators+0x217:
80ca137d 6609b7da000000 or word ptr [edi+0DAh],si ds:0023:899c10e2=0000
status = IopQueryResourceHandlerInterface(ResourceTranslator,
deviceNode->PhysicalDeviceObject,
resourceType,
&interface); 返回到这里:
deviceNode->QueryTranslatorMask |= resourceMask;
if (!NT_SUCCESS(status)) {
deviceNode->NoTranslatorMask |= resourceMask;
if (resourceType <= PI_MAXIMUM_RESOURCE_TYPE_TRACKED) {
found = TRUE;
} else {
interface = NULL;
}
}
//
// Move up to current device node's parent
//
deviceNode = deviceNode->Parent; 继续向上寻找。
}
while (deviceNode) {
if ((deviceNode == IopRootDeviceNode) && (translatorFound == FALSE)) {
if ((arbiterFound == FALSE) && (deviceNode->PhysicalDeviceObject != deviceObject)) {
found = IopFindResourceHandlerInfo(
ResourceArbiter,
deviceNode,
resourceType,
&arbiterEntry);
0: kd> kc
00 nt!IopFindResourceHandlerInfo
01 nt!IopSetupArbiterAndTranslators
02 nt!IopResourceRequirementsListToReqList
03 nt!IopAllocateBootResourcesInternal
04 nt!IopAllocateBootResources
05 nt!IopReportBootResources
06 nt!PiQueryAndAllocateBootResources
07 nt!PiProcessNewDeviceNode
08 nt!PipProcessDevNodeTree
09 nt!PipDeviceActionWorker
0a nt!PipRequestDeviceAction
0b nt!IopInitializeBootDrivers
0c nt!IoInitSystem
0d nt!Phase1Initialization
0e nt!PspSystemThreadStartup
0f nt!KiThreadStartup
0: kd> dv
HandlerType = ResourceArbiter (0n2)
DeviceNode = 0x899c5850
ResourceType = 0x06 ''
HandlerEntry = 0xf789a188
0: kd> dx -r1 ((ntkrnlmp!_DEVICE_NODE *)0x899c5bc8)
((ntkrnlmp!_DEVICE_NODE *)0x899c5bc8) : 0x899c5bc8 [Type: _DEVICE_NODE *]
+0x000\] Sibling : 0x0 \[Type: _DEVICE_NODE \*
+0x004\] Child : 0x899c5850 \[Type: _DEVICE_NODE \*
+0x008\] Parent : 0x0 \[Type: _DEVICE_NODE \*
+0x00c\] LastChild : 0x89983478 \[Type: _DEVICE_NODE \*
+0x010\] Level : 0x0 \[Type: unsigned long
+0x014\] Notify : 0x0 \[Type: _PO_DEVICE_NOTIFY \*
+0x018\] State : DeviceNodeStarted (776) \[Type: _PNP_DEVNODE_STATE
+0x01c\] PreviousState : DeviceNodeEnumerateCompletion (781) \[Type: _PNP_DEVNODE_STATE
+0x020\] StateHistory \[Type: _PNP_DEVNODE_STATE \[20\]
+0x070\] StateHistoryEntry : 0x5 \[Type: unsigned long
+0x074\] CompletionStatus : 0 \[Type: long
+0x078\] PendingIrp : 0x0 \[Type: _IRP \*
+0x07c\] Flags : 0x131 \[Type: unsigned long
+0x080\] UserFlags : 0x0 \[Type: unsigned long
+0x084\] Problem : 0x0 \[Type: unsigned long
+0x088\] PhysicalDeviceObject : 0x899c5d08 : Device for "\\Driver\\PnpManager" \[Type: _DEVICE_OBJECT \*
+0x08c\] ResourceList : 0x0 \[Type: _CM_RESOURCE_LIST \*
+0x090\] ResourceListTranslated : 0x0 \[Type: _CM_RESOURCE_LIST \*
+0x094\] InstancePath : "HTREE\\ROOT\\0" \[Type: _UNICODE_STRING
+0x09c\] ServiceName : "" \[Type: _UNICODE_STRING
+0x0a4\] DuplicatePDO : 0x0 \[Type: _DEVICE_OBJECT \*
+0x0a8\] ResourceRequirements : 0x0 \[Type: _IO_RESOURCE_REQUIREMENTS_LIST \*
+0x0ac\] InterfaceType : InterfaceTypeUndefined (-1) \[Type: _INTERFACE_TYPE
+0x0b0\] BusNumber : 0xffffffff \[Type: unsigned long
+0x0b4\] ChildInterfaceType : InterfaceTypeUndefined (-1) \[Type: _INTERFACE_TYPE
+0x0b8\] ChildBusNumber : 0xffffffff \[Type: unsigned long
+0x0bc\] ChildBusTypeIndex : 0xffff \[Type: unsigned short
+0x0be\] RemovalPolicy : 0x0 \[Type: unsigned char
+0x0bf\] HardwareRemovalPolicy : 0x0 \[Type: unsigned char
+0x0c0\] TargetDeviceNotify \[Type: _LIST_ENTRY
+0x0c8\] DeviceArbiterList \[Type: _LIST_ENTRY
+0x0d0\] DeviceTranslatorList \[Type: _LIST_ENTRY
+0x0d8\] NoTranslatorMask : 0x0 \[Type: unsigned short
+0x0da\] QueryTranslatorMask : 0x0 \[Type: unsigned short
+0x0dc\] NoArbiterMask : 0x0 \[Type: unsigned short
+0x0de\] QueryArbiterMask : 0x4 \[Type: unsigned short
0: kd> dx -r1 (*((ntkrnlmp!_LIST_ENTRY *)0x899c5c90))
(*((ntkrnlmp!_LIST_ENTRY *)0x899c5c90)) [Type: _LIST_ENTRY]
+0x000\] Flink : 0xe127f3b0 \[Type: _LIST_ENTRY \*
+0x004\] Blink : 0xe127f3b0 \[Type: _LIST_ENTRY \*
0: kd> dt PI_RESOURCE_ARBITER_ENTRY 0xe127f3b0
nt!PI_RESOURCE_ARBITER_ENTRY
+0x000 DeviceArbiterList : _LIST_ENTRY [ 0x899c5c90 - 0x899c5c90 ]
+0x008 ResourceType : 0x2 ''
+0x00c ArbiterInterface : 0xe127f808 _ARBITER_INTERFACE
+0x010 Level : 0
+0x014 ResourceList : _LIST_ENTRY [ 0xe127f3c4 - 0xe127f3c4 ]
+0x01c BestResourceList : _LIST_ENTRY [ 0xe127f3cc - 0xe127f3cc ]
+0x024 BestConfig : _LIST_ENTRY [ 0xe127f3d4 - 0xe127f3d4 ]
+0x02c ActiveArbiterList : _LIST_ENTRY [ 0xe127f3dc - 0xe127f3dc ]
+0x034 State : 0 ''
+0x035 ResourcesChanged : 0 ''
0: kd> dx -id 0,0,899a2278 -r1 ((ntkrnlmp!_ARBITER_INTERFACE *)0xe127f808)
((ntkrnlmp!_ARBITER_INTERFACE *)0xe127f808) : 0xe127f808 [Type: _ARBITER_INTERFACE *]
+0x000\] Size : 0x18 \[Type: unsigned short
+0x002\] Version : 0x0 \[Type: unsigned short
+0x004\] Context : 0x80b1f340 \[Type: void \*
+0x008\] InterfaceReference : 0x0 \[Type: void (\*)(void \*)
+0x00c\] InterfaceDereference : 0x0 \[Type: void (\*)(void \*)
+0x010\] ArbiterHandler : 0x80dc51ee \[Type: long (\*)(void \*,_ARBITER_ACTION,_ARBITER_PARAMETERS \*)
+0x014\] Flags : 0x0 \[Type: unsigned long
0: kd> u 80dc51ee
nt!ArbArbiterHandler [d:\srv03rtm\base\ntos\arb\arbiter.c @ 1461]:
80dc51ee 55 push ebp
80dc51ef 8bec mov ebp,esp
80dc51f1 53 push ebx
80dc51f2 56 push esi
80dc51f3 8b350831a080 mov esi,dword ptr [nt!_imp__KeGetCurrentIrql (80a03108)]
80dc51f9 57 push edi
80dc51fa ffd6 call esi
80dc51fc 3c01 cmp al,1
if (found == FALSE) {
//
// no information found on arbiter. Try to query translator interface ...
//
if (resourceType <= PI_MAXIMUM_RESOURCE_TYPE_TRACKED) {
resourceMask = 1 << resourceType;
} else {
resourceMask = 0;
}
status = IopQueryResourceHandlerInterface(ResourceArbiter,
deviceNode->PhysicalDeviceObject,
resourceType,
&interface);
0: kd> kc
00 nt!IopQueryResourceHandlerInterface
01 nt!IopSetupArbiterAndTranslators
02 nt!IopResourceRequirementsListToReqList
03 nt!IopAllocateBootResourcesInternal
04 nt!IopAllocateBootResources
05 nt!IopReportBootResources
06 nt!PiQueryAndAllocateBootResources
07 nt!PiProcessNewDeviceNode
08 nt!PipProcessDevNodeTree
09 nt!PipDeviceActionWorker
0a nt!PipRequestDeviceAction
0b nt!IopInitializeBootDrivers
0c nt!IoInitSystem
0d nt!Phase1Initialization
0e nt!PspSystemThreadStartup
0f nt!KiThreadStartup
0: kd> dv
HandlerType = ResourceArbiter (0n2)
DeviceObject = 0x899c59a8 Device for "\Driver\PnpManager"
ResourceType = 0x06 ''
case ResourceArbiter:
size = sizeof(ARBITER_INTERFACE);
interfaceType = GUID_ARBITER_INTERFACE_STANDARD;
break;
irpSp.MajorFunction = IRP_MJ_PNP;
irpSp.MinorFunction = IRP_MN_QUERY_INTERFACE;
//
// Set the pointer to the resource list
//
irpSp.Parameters.QueryInterface.InterfaceType = &interfaceType;
irpSp.Parameters.QueryInterface.Size = interface->Size;
irpSp.Parameters.QueryInterface.Version = interface->Version = 0;
irpSp.Parameters.QueryInterface.Interface = interface;
irpSp.Parameters.QueryInterface.InterfaceSpecificData = (PVOID) (ULONG_PTR) ResourceType;
//
0: kd> kc
00 hal!HalpDispatchPnp
01 nt!IofCallDriver
02 nt!IopSynchronousCall
03 nt!IopQueryResourceHandlerInterface
04 nt!IopSetupArbiterAndTranslators
05 nt!IopResourceRequirementsListToReqList
06 nt!IopAllocateBootResourcesInternal
07 nt!IopAllocateBootResources
08 nt!IopReportBootResources
09 nt!PiQueryAndAllocateBootResources
0a nt!PiProcessNewDeviceNode
0b nt!PipProcessDevNodeTree
0c nt!PipDeviceActionWorker
0d nt!PipRequestDeviceAction
0e nt!IopInitializeBootDrivers
0f nt!IoInitSystem
10 nt!Phase1Initialization
11 nt!PspSystemThreadStartup
12 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x899c1f00 Device for "\Driver\ACPI_HAL"
Irp = 0x899bf5b0
0: kd> !Irp 0x899bf5b0
Irp is active with 2 stacks 2 is current (= 0x899bf644)
No Mdl: No System Buffer: Thread 899a1020: Irp stack trace.
cmd flg cl Device File Completion-Context
N/A(0), N/A(0)
0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
>[IRP_MJ_PNP(1b), IRP_MN_QUERY_INTERFACE(8)]
0 0 899c1f00 00000000 00000000-00000000
\Driver\ACPI_HAL
Args: f789a144 00000018 e1278768 00000006
0: kd> kc
00 hal!HalpQueryInterface
01 hal!HalpDispatchPnp
02 nt!IofCallDriver
03 nt!IopSynchronousCall
04 nt!IopQueryResourceHandlerInterface
05 nt!IopSetupArbiterAndTranslators
06 nt!IopResourceRequirementsListToReqList
07 nt!IopAllocateBootResourcesInternal
08 nt!IopAllocateBootResources
09 nt!IopReportBootResources
0a nt!PiQueryAndAllocateBootResources
0b nt!PiProcessNewDeviceNode
0c nt!PipProcessDevNodeTree
0d nt!PipDeviceActionWorker
0e nt!PipRequestDeviceAction
0f nt!IopInitializeBootDrivers
10 nt!IoInitSystem
11 nt!Phase1Initialization
12 nt!PspSystemThreadStartup
13 nt!KiThreadStartup
0: kd> dv
DeviceObject = 0x899c1f00 Device for "\Driver\ACPI_HAL"
InterfaceType = 0xf789a144 {E644F185-8C0E-11D0-BECF-08002BE2092F}
DEFINE_GUID( GUID_BUS_INTERFACE_STANDARD, 0x496B8280L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F );
不符合条件。
0: kd> gu
eax=c00000bb ebx=e12be0b8 ecx=00120001 edx=00110000 esi=00000040 edi=899c5850
eip=80ca1263 esp=f789a16c ebp=f789a198 iopl=0 nv up ei pl zr na pe cy
cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00000247
nt!IopSetupArbiterAndTranslators+0xfd:
80ca1263 6609b7de000000 or word ptr [edi+0DEh],si ds:0023:899c592e=0004