nt!PiProcessNewDeviceNode函数分析之得到HID和CID0: kd kc#00 nt!PpQueryID01 nt!PiProcessNewDeviceNode02 nt!PipProcessDevNodeTree03 nt!PipDeviceActionWorker04 nt!PipRequestDeviceAction05 nt!IopInitializeBootDrivers06 nt!IoInitSystem07 nt!Phase1Initialization08 nt!PspSystemThreadStartup09 nt!KiThreadStartup0: kd dvDeviceNode 0x894ffea8IDType BusQueryHardwareIDs (0n1)ID 0xf789a378IDLength 0xf789a348status 0n-141974712reason struct _UNICODE_STRING --- memory read error at address 0x00000008 ---0: kd kc#00 ACPI!ACPIDispatchIrp01 nt!IofCallDriver02 nt!IopSynchronousCall03 nt!PpIrpQueryID04 nt!PpQueryID05 nt!PiProcessNewDeviceNode06 nt!PipProcessDevNodeTree07 nt!PipDeviceActionWorker08 nt!PipRequestDeviceAction09 nt!IopInitializeBootDrivers0a nt!IoInitSystem0b nt!Phase1Initialization0c nt!PspSystemThreadStartup0d nt!KiThreadStartup0: kd dvDeviceObject 0x899050e8 Device for \Driver\ACPIIrp 0x899052200: kd !Irp 0x89905220Irp is active with 1 stacks 1 is current ( 0x89905290)No Mdl: No System Buffer: Thread 899a1020: Irp stack trace.cmd flg cl Device File Completion-Context[IRP_MJ_PNP(1b), IRP_MN_QUERY_ID(13)]0 0 899050e8 00000000 00000000-00000000\Driver\ACPIArgs: 00000001 00000000 00000000 000000000: kd kc#00 ACPI!ACPIBusIrpQueryId01 ACPI!ACPIDispatchIrp02 nt!IofCallDriver03 nt!IopSynchronousCall04 nt!PpIrpQueryID05 nt!PpQueryID06 nt!PiProcessNewDeviceNode07 nt!PipProcessDevNodeTree08 nt!PipDeviceActionWorker09 nt!PipRequestDeviceAction0a nt!IopInitializeBootDrivers0b nt!IoInitSystem0c nt!Phase1Initialization0d nt!PspSystemThreadStartup0e nt!KiThreadStartup0: kd dvDeviceObject 0x899050e8 Device for \Driver\ACPIIrp 0x89905220case BusQueryHardwareIDs://// Get the device ID as a normal string//status ACPIGetHardwareIDSyncWide(deviceExtension,baseBuffer,baseBufferSize);//// This macro is used to get an instance ID, in the wide format, sync//#define ACPIGetHardwareIDSyncWide( \DeviceExtension, \Buffer, \BufferSize \) \ACPIGetHardwareID( \DeviceExtension, \(GET_PROP_SKIP_CALLBACK | \GET_CONVERT_TO_WIDESTRING), \NULL, \NULL, \Buffer, \BufferSize \)#define ACPIGetHardwareID( \DeviceExtension, \Flags, \CallBack, \Context, \Buffer, \BufferSize \) \ACPIGet( \DeviceExtension, \PACKED_HID, \(GET_REQUEST_STRING | \GET_CONVERT_TO_HARDWAREID | \GET_TYPE_INTEGER | \GET_TYPE_STRING | \Flags ), \NULL, \0, \CallBack, \Context, \Buffer, \(PULONG) BufferSize \)Device (PCI0){Name (_HID, EisaId (PNP0A03)) // _HID: Hardware IDName (_CID, EisaId (PNP0A08)) // _CID: Compatible IDName (_BBN, 0x00) // _BBN: BIOS Bus NumberName (_ADR, 0x00) // _ADR: AddressOperationRegion (REGS, PCI_Config, 0x50, 0x30)0: kd kc#00 ACPI!ACPIGet01 ACPI!ACPIBusIrpQueryId02 ACPI!ACPIDispatchIrp03 nt!IofCallDriver04 nt!IopSynchronousCall05 nt!PpIrpQueryID06 nt!PpQueryID07 nt!PiProcessNewDeviceNode08 nt!PipProcessDevNodeTree09 nt!PipDeviceActionWorker0a nt!PipRequestDeviceAction0b nt!IopInitializeBootDrivers0c nt!IoInitSystem0d nt!Phase1Initialization0e nt!PspSystemThreadStartup0f nt!KiThreadStartup0: kd db f789a19cf789a19c 4d dc 43 f7 58 0d 9c 89-5f 48 49 44 56 00 08 20 M.C.X..._HIDV..0: kd gBreakpoint 98 hiteax899b0024 ebx00000000 ecx899b0024 edx00000000 esi899b0024 edi89968680eipf741fe16 espf789a120 ebpf789a144 iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246ACPI!SyncEvalObject:f741fe16 55 push ebp0: kd gBreakpoint 37 hiteaxf789a104 ebx00000000 ecx8997e000 edx00002707 esi804edc6c edi89968680eipf741f8c9 espf789a0c8 ebpf789a11c iopl0 nv up ei ng nz ac pe cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000297ACPI!AsyncEvalObject:f741f8c9 55 push ebp0: kd gBreakpoint 42 hiteax00000000 ebx899b0040 ecx899b0040 edx89569fe4 esif7438ca8 edi00000000eipf74207d4 espf789a0a4 ebpf789a0c4 iopl0 nv up ei ng nz ac pe cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000297ACPI!RestartContext:f74207d4 55 push ebp0: kd gBreakpoint 39 hiteax00000088 ebx00000000 ecx8997e000 edx00002707 esi89568000 edi00000000eipf741d710 espf789a05c ebpf789a080 iopl0 nv up ei ng nz ac po cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000293ACPI!RunContext:f741d710 55 push ebp0: kd gBreakpoint 10 hiteax00000000 ebx89905220 ecx04e40001 edx04e30000 esic00000bb edi00000000eipf743dc4d espf789a1c4 ebpf789a1dc iopl0 nv up ei pl zr na pe cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000247ACPI!ACPIBusIrpQueryId0x133:f743dc4d 8bf0 mov esi,eax0: kd dvDeviceObject 0x899c0d58 Device for {...}Irp 0xe1272188baseBuffer 0xe1272188 AdeviceExtension 0x899c0d58minorFunction 0x13 type BusQueryHardwareIDs (0n1)irpStack 0x00000001baseBufferSize Memory access error0: kd db 0xe1272188e1272188 41 00 43 00 50 00 49 00-5c 00 50 00 4e 00 50 00 A.C.P.I.\.P.N.P.e1272198 30 00 41 00 30 00 33 00-00 00 2a 00 50 00 4e 00 0.A.0.3...*.P.N.0: kd gueax00000000 ebx89905213 ecx80ae0dfa edx80b18958 esif743db1a edi00000000eipf740410e espf789a1ec ebpf789a210 iopl0 nv up ei ng nz ac po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000292ACPI!ACPIDispatchIrp0x19e:f740410e ff75fc push dword ptr [ebp-4] ss:0010:f789a20c899c0d580: kd gueax00000000 ebx00000000 ecx899c0e74 edx80b18958 esi89905220 edi899050e8eip80a2675c espf789a220 ebpf789a22c iopl0 nv up ei pl nz na po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000202nt!IofCallDriver0x62:80a2675c 5f pop edi0: kd gueax00000000 ebx899050e8 ecx899c0e74 edx80b18958 esif789a2a0 edi899052b4eip80c95e00 espf789a234 ebpf789a25c iopl0 nv up ei pl nz na po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000202nt!IopSynchronousCall0x1aa:80c95e00 8bf0 mov esi,eax0: kd gueax00000000 ebx00000001 ecxe1272188 edx80b18958 esif789a378 edif789a2a0eip80c97a60 espf789a270 ebpf789a2a0 iopl0 nv up ei ng nz ac po cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000293nt!PpIrpQueryID0x96:80c97a60 33ff xor edi,edi0: kd gueax00000000 ebxf789a348 ecxe1272188 edx80b18958 esi894ffea8 edi899a1020eip80c8a3a6 espf789a2b4 ebpf789a2c8 iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246nt!PpQueryID0x80:80c8a3a6 33c9 xor ecx,ecxcase BusQueryHardwareIDs:case BusQueryCompatibleIDs:*IDLength PiFixupID(*ID,MAX_DEVICE_ID_LEN,TRUE,(ULONG)-1,DeviceNode-Parent-ServiceName);break;0: kd kc#00 nt!PiFixupID01 nt!PpQueryID02 nt!PiProcessNewDeviceNode03 nt!PipProcessDevNodeTree04 nt!PipDeviceActionWorker05 nt!PipRequestDeviceAction06 nt!IopInitializeBootDrivers07 nt!IoInitSystem08 nt!Phase1Initialization09 nt!PspSystemThreadStartup0a nt!KiThreadStartup0: kd dvID 0xe1272188MaxIDLength 0xc8Multi 0x01 AllowedSeparators 0xffffffffLogString 0x899c10a4 ACPIreason separators 80: kd dx -r1 ((ntkrnlmp!unsigned short *)0xe1272188)((ntkrnlmp!unsigned short *)0xe1272188) : 0xe1272188 : 0x41 [Type: unsigned short *]0x41 [Type: unsigned short]0: kd db 0xe1272188e1272188 41 00 43 00 50 00 49 00-5c 00 50 00 4e 00 50 00 A.C.P.I.\.P.N.P.e1272198 30 00 41 00 30 00 33 00-00 00 2a 00 50 00 4e 00 0.A.0.3...*.P.N.e12721a8 50 00 30 00 41 00 30 00-33 00 00 00 00 00 b2 b2 P.0.A.0.3.......0: kd dvhwIDLength 0x2ehwIDs 0xe1272188PpQueryCompatibleIDs(DeviceNode,compatibleIDs,compatibleIDLength);0: kd gBreakpoint 74 hiteax0000001b ebx00000000 ecx89981f38 edx89905220 esi89905220 edi899050e8eipf7403f70 espf789a214 ebpf789a22c iopl0 nv up ei ng nz na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000286ACPI!ACPIDispatchIrp:f7403f70 55 push ebp0: kd kc#00 ACPI!ACPIDispatchIrp01 nt!IofCallDriver02 nt!IopSynchronousCall03 nt!PpIrpQueryID04 nt!PpQueryID05 nt!PiProcessNewDeviceNode06 nt!PipProcessDevNodeTree07 nt!PipDeviceActionWorker08 nt!PipRequestDeviceAction09 nt!IopInitializeBootDrivers0a nt!IoInitSystem0b nt!Phase1Initialization0c nt!PspSystemThreadStartup0d nt!KiThreadStartup0: kd gBreakpoint 5 hiteax00000002 ebx89905213 ecx899c0e74 edxf745b068 esif743db1a edi00000000eipf740410c espf789a1e4 ebpf789a210 iopl0 nv up ei pl nz na po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000202ACPI!ACPIDispatchIrp0x19c:f740410c ffd6 call esi {ACPI!ACPIBusIrpQueryId (f743db1a)}0: kd gBreakpoint 71 hiteax899c0d58 ebx89905220 ecxf789a1e8 edx00000002 esic00000bb edi00000000eipf74076b8 espf789a19c ebpf789a1dc iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246ACPI!ACPIGet:f74076b8 55 push ebp0: kd db f789a19cf789a19c 14 dc 43 f7 58 0d 9c 89-5f 43 49 44 17 01 08 20 ..C.X..._CID...0: kd gBreakpoint 29 hiteax00000000 ebxf743b938 ecx05402000 edx00000000 esi89968640 edi89968648eipf74078d8 espf789a154 ebpf789a198 iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246ACPI!ACPIGet0x220:f74078d8 e83b2bffff call ACPI!ACPIAmliGetNamedChild (f73fa418)0: kd gBreakpoint 98 hiteax899b0068 ebx00000000 ecx899b0068 edx00000000 esi899b0068 edi89968680eipf741fe16 espf789a120 ebpf789a144 iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246ACPI!SyncEvalObject:f741fe16 55 push ebp0: kd gBreakpoint 37 hiteaxf789a104 ebx00000000 ecx8997e000 edx00002707 esi804edc6c edi89968680eipf741f8c9 espf789a0c8 ebpf789a11c iopl0 nv up ei ng nz ac po cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000293ACPI!AsyncEvalObject:f741f8c9 55 push ebp0: kd gBreakpoint 42 hiteax00000000 ebx899b0084 ecx899b0084 edx89569fe4 esif7438ca8 edi00000000eipf74207d4 espf789a0a4 ebpf789a0c4 iopl0 nv up ei ng nz ac pe cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000297ACPI!RestartContext:f74207d4 55 push ebp0: kd gBreakpoint 39 hiteax0000008f ebx00000000 ecx8997e000 edx00002707 esi89568000 edi00000000eipf741d710 espf789a05c ebpf789a080 iopl0 nv up ei ng nz na pe cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000287ACPI!RunContext:f741d710 55 push ebpNTSTATUSACPIGetConvertToStringWide(IN PDEVICE_EXTENSION DeviceExtension,IN NTSTATUS Status,IN POBJDATA Result,IN ULONG Flags,OUT PVOID *Buffer,OUT ULONG *BufferSize OPTIONAL){//// For a string, make sure that there is no leading * and// account for the fact that we will preceed the string with// a * and NULL//memSize strlen(Result-pbDataBuff) 1;0: kd gBreakpoint 10 hiteax00000000 ebx89905220 ecx04e50001 edx04e40000 esic00000bb edi00000000eipf743dc14 espf789a1c4 ebpf789a1dc iopl0 nv up ei pl zr na po cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000243ACPI!ACPIBusIrpQueryId0xfa:f743dc14 8bf0 mov esi,eax0: kd dvDeviceObject 0x899c0d58 Device for {...}Irp 0xe12857d0baseBuffer 0xe12857d0 *0: kd db 0xe12857d0e12857d0 2a 00 50 00 4e 00 50 00-30 00 41 00 30 00 38 00 *.P.N.P.0.A.0.8.0: kd gueax00000000 ebx89905213 ecx80ae0dfa edx80b18958 esif743db1a edi00000000eipf740410e espf789a1ec ebpf789a210 iopl0 nv up ei ng nz ac po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000292ACPI!ACPIDispatchIrp0x19e:f740410e ff75fc push dword ptr [ebp-4] ss:0010:f789a20c899c0d580: kd gueax00000000 ebx00000000 ecx899c0e74 edx80b18958 esi89905220 edi899050e8eip80a2675c espf789a220 ebpf789a22c iopl0 nv up ei pl nz na po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000202nt!IofCallDriver0x62:80a2675c 5f pop edi0: kd gueax00000000 ebx899050e8 ecx899c0e74 edx80b18958 esif789a2a0 edi899052b4eip80c95e00 espf789a234 ebpf789a25c iopl0 nv up ei pl nz na po nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000202nt!IopSynchronousCall0x1aa:80c95e00 8bf0 mov esi,eax0: kd gueax00000000 ebx00000002 ecxe12857d0 edx80b18958 esif789a37c edif789a2a0eip80c97a60 espf789a270 ebpf789a2a0 iopl0 nv up ei ng nz ac po cycs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000293nt!PpIrpQueryID0x96:80c97a60 33ff xor edi,edi0: kd gueax00000000 ebxf789a34c ecxe12857d0 edx80b18958 esi894ffea8 edi899a1020eip80c8a3a6 espf789a2b4 ebpf789a2c8 iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246nt!PpQueryID0x80:80c8a3a6 33c9 xor ecx,ecx0: kd gueax00000000 ebx00000000 ecx00000000 edxe12857d0 esi894ffea8 edi899a1020eip80c9417b espf789a2e0 ebpf789a38c iopl0 nv up ei pl zr na pe nccs0008 ss0010 ds0023 es0023 fs0030 gs0000 efl00000246nt!PiProcessNewDeviceNode0x8f9:80c9417b 648b3d24010000 mov edi,dword ptr fs:[124h] fs:0030:00000124899a10200: kd dv compatibleIDscompatibleIDs 0xe12857d00: kd db 0xe12857d0e12857d0 2a 00 50 00 4e 00 50 00-30 00 41 00 30 00 38 00 *.P.N.P.0.A.0.8.e12857e0 00 00 00 00 00 00 b2 b2-04 08 04 0c 43 4d 4e e2 ............CMN.e12857f0 01 00 01 00 da bf 3d 00-00 00 00 00 04 00 4e 44 .............NDe1285800 49 53 00 00 01 00 b2 b2-04 08 08 0c 43 4d 44 61 IS..........CMDae1285810 01 00 1c 00 76 6b 05 00-18 00 00 00 00 68 0e 00 ....vk.......h..e1285820 01 00 00 00 01 00 b2 b2-47 72 6f 75 70 b2 b2 b2 ........Group...e1285830 46 00 69 00 6c 00 65 00-20 00 73 00 79 00 73 00 F.i.l.e. .s.y.s.e1285840 74 00 65 00 6d 00 00 00-08 08 07 0c 53 64 62 61 t.e.m.......Sdba0: kd dv compatibleIDLengthcompatibleIDLength 0x14