📄 testpnp.cod
字号:
; 612 : pdoData = CONTAINING_RECORD (entry, PDO_DEVICE_DATA, Link);
00048 8b 45 f8 mov eax, DWORD PTR _entry$[ebp]
0004b 83 e8 1c sub eax, 28 ; 0000001cH
0004e 89 45 ec mov DWORD PTR _pdoData$[ebp], eax
; 613 : if (!handle) {
00051 83 7d f4 00 cmp DWORD PTR _handle$[ebp], 0
00055 0f 85 08 00 00
00 jne $L2897
; 614 : handle = pdoData->Self;
0005b 8b 45 ec mov eax, DWORD PTR _pdoData$[ebp]
0005e 8b 00 mov eax, DWORD PTR [eax]
00060 89 45 f4 mov DWORD PTR _handle$[ebp], eax
$L2897:
; 615 : }
; 616 : if (handle == Remove->HardwareHandle) {
00063 8b 45 08 mov eax, DWORD PTR _Remove$[ebp]
00066 8b 4d f4 mov ecx, DWORD PTR _handle$[ebp]
00069 39 48 04 cmp DWORD PTR [eax+4], ecx
0006c 0f 85 34 00 00
00 jne $L2898
; 617 : pdoData->Attached = FALSE;
00072 8b 45 ec mov eax, DWORD PTR _pdoData$[ebp]
00075 c6 40 1a 00 mov BYTE PTR [eax+26], 0
; 618 : RemoveEntryList (&pdoData->Link);
00079 8b 45 ec mov eax, DWORD PTR _pdoData$[ebp]
0007c 8b 40 1c mov eax, DWORD PTR [eax+28]
0007f 89 45 e8 mov DWORD PTR __EX_Flink$2900[ebp], eax
00082 8b 45 ec mov eax, DWORD PTR _pdoData$[ebp]
00085 8b 40 20 mov eax, DWORD PTR [eax+32]
00088 89 45 e4 mov DWORD PTR __EX_Blink$2899[ebp], eax
0008b 8b 45 e8 mov eax, DWORD PTR __EX_Flink$2900[ebp]
0008e 8b 4d e4 mov ecx, DWORD PTR __EX_Blink$2899[ebp]
00091 89 01 mov DWORD PTR [ecx], eax
00093 8b 45 e4 mov eax, DWORD PTR __EX_Blink$2899[ebp]
00096 8b 4d e8 mov ecx, DWORD PTR __EX_Flink$2900[ebp]
00099 89 41 04 mov DWORD PTR [ecx+4], eax
; 619 : FdoData->NumPDOs--;
0009c 8b 45 0c mov eax, DWORD PTR _FdoData$[ebp]
0009f ff 48 24 dec DWORD PTR [eax+36]
; 620 : found = TRUE;
000a2 c6 45 f0 01 mov BYTE PTR _found$[ebp], 1
$L2898:
; 621 : }
; 622 : }
000a6 e9 86 ff ff ff jmp $L2895
$L2896:
; 623 : KeReleaseSpinLock (&FdoData->Spin, irql);
000ab 8b 4d 0c mov ecx, DWORD PTR _FdoData$[ebp]
000ae 8b 55 fc mov edx, DWORD PTR _irql$[ebp]
000b1 83 c1 14 add ecx, 20 ; 00000014H
000b4 ff 15 00 00 00
00 call DWORD PTR __imp_@KfReleaseSpinLock@8
; 624 :
; 625 : if (found) {
000ba 33 c0 xor eax, eax
000bc 8a 45 f0 mov al, BYTE PTR _found$[ebp]
000bf 85 c0 test eax, eax
000c1 0f 84 16 00 00
00 je $L2901
; 626 : IoInvalidateDeviceRelations (FdoData->UnderlyingPDO, BusRelations);
000c7 6a 00 push 0
000c9 8b 45 0c mov eax, DWORD PTR _FdoData$[ebp]
000cc 8b 40 28 mov eax, DWORD PTR [eax+40]
000cf 50 push eax
000d0 ff 15 00 00 00
00 call DWORD PTR __imp__IoInvalidateDeviceRelations@8
; 627 : return STATUS_SUCCESS;
000d6 33 c0 xor eax, eax
000d8 e9 0a 00 00 00 jmp $L2888
$L2901:
; 628 : }
; 629 : return STATUS_INVALID_PARAMETER;
000dd b8 0d 00 00 c0 mov eax, -1073741811 ; c000000dH
000e2 e9 00 00 00 00 jmp $L2888
$L2888:
; 630 : }
000e7 5f pop edi
000e8 5e pop esi
000e9 5b pop ebx
000ea c9 leave
000eb c2 08 00 ret 8
_Test98_Remove@8 ENDP
_TEXT ENDS
PUBLIC _Test98_Power@8
PUBLIC _Test98_FDO_Power@8
; COMDAT _Test98_Power@8
_TEXT SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_irpStack$ = -12
_status$ = -8
_commonData$ = -4
_Test98_Power@8 PROC NEAR ; COMDAT
; 643 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 ec 0c sub esp, 12 ; 0000000cH
00006 53 push ebx
00007 56 push esi
00008 57 push edi
; 644 : PIO_STACK_LOCATION irpStack;
; 645 : NTSTATUS status;
; 646 : PCOMMON_DEVICE_DATA commonData;
; 647 :
; 648 : PAGED_CODE ();
; 649 :
; 650 : status = STATUS_SUCCESS;
00009 c7 45 f8 00 00
00 00 mov DWORD PTR _status$[ebp], 0
; 651 : irpStack = IoGetCurrentIrpStackLocation (Irp);
00010 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00013 8b 40 60 mov eax, DWORD PTR [eax+96]
00016 89 45 f4 mov DWORD PTR _irpStack$[ebp], eax
; 652 : ASSERT (IRP_MJ_POWER == irpStack->MajorFunction);
; 653 :
; 654 : commonData = (PCOMMON_DEVICE_DATA) DeviceObject->DeviceExtension;
00019 8b 45 08 mov eax, DWORD PTR _DeviceObject$[ebp]
0001c 8b 40 28 mov eax, DWORD PTR [eax+40]
0001f 89 45 fc mov DWORD PTR _commonData$[ebp], eax
; 655 :
; 656 : status = Test98_FDO_Power ((PFDO_DEVICE_DATA) DeviceObject->DeviceExtension,
; 657 : Irp);
00022 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00025 50 push eax
00026 8b 45 08 mov eax, DWORD PTR _DeviceObject$[ebp]
00029 8b 40 28 mov eax, DWORD PTR [eax+40]
0002c 50 push eax
0002d e8 00 00 00 00 call _Test98_FDO_Power@8
00032 89 45 f8 mov DWORD PTR _status$[ebp], eax
; 658 : return status;
00035 8b 45 f8 mov eax, DWORD PTR _status$[ebp]
00038 e9 00 00 00 00 jmp $L2904
$L2904:
; 659 : }
0003d 5f pop edi
0003e 5e pop esi
0003f 5b pop ebx
00040 c9 leave
00041 c2 08 00 ret 8
_Test98_Power@8 ENDP
_TEXT ENDS
PUBLIC _Test98_PowerComplete@12
EXTRN __imp__PoRequestPowerIrp@24:NEAR
EXTRN __imp__PoSetPowerState@12:NEAR
EXTRN __imp__PoCallDriver@8:NEAR
EXTRN __imp__PoStartNextPowerIrp@4:NEAR
; COMDAT _Test98_FDO_Power@8
_TEXT SEGMENT
_Data$ = 8
_Irp$ = 12
_status$ = -16
_hookit$ = -12
_powerState$ = -4
_powerType$ = -20
_stack$ = -8
_irpSp$2944 = -28
_nextIrpSp$2945 = -24
_irpSp$2947 = -32
_Test98_FDO_Power@8 PROC NEAR ; COMDAT
; 676 : {
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 83 ec 28 sub esp, 40 ; 00000028H
00006 53 push ebx
00007 56 push esi
00008 57 push edi
; 677 : NTSTATUS status;
; 678 : BOOLEAN hookit = FALSE;
00009 c6 45 f4 00 mov BYTE PTR _hookit$[ebp], 0
; 679 : POWER_STATE powerState;
; 680 : POWER_STATE_TYPE powerType;
; 681 : PIO_STACK_LOCATION stack;
; 682 :
; 683 : stack = IoGetCurrentIrpStackLocation (Irp);
0000d 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00010 8b 40 60 mov eax, DWORD PTR [eax+96]
00013 89 45 f8 mov DWORD PTR _stack$[ebp], eax
; 684 : powerType = stack->Parameters.Power.Type;
00016 8b 45 f8 mov eax, DWORD PTR _stack$[ebp]
00019 8b 40 08 mov eax, DWORD PTR [eax+8]
0001c 89 45 ec mov DWORD PTR _powerType$[ebp], eax
; 685 : powerState = stack->Parameters.Power.State;
0001f 8b 45 f8 mov eax, DWORD PTR _stack$[ebp]
00022 8b 40 0c mov eax, DWORD PTR [eax+12]
00025 89 45 fc mov DWORD PTR _powerState$[ebp], eax
; 686 :
; 687 : PAGED_CODE ();
; 688 :
; 689 : status = Test98_IncIoCount (Data);
00028 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
0002b 50 push eax
0002c e8 00 00 00 00 call _Test98_IncIoCount@4
00031 89 45 f0 mov DWORD PTR _status$[ebp], eax
; 690 : if (!NT_SUCCESS (status)) {
00034 83 7d f0 00 cmp DWORD PTR _status$[ebp], 0
00038 0f 8d 30 00 00
00 jge $L2920
; 691 : PoStartNextPowerIrp (Irp);
0003e 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00041 50 push eax
00042 ff 15 00 00 00
00 call DWORD PTR __imp__PoStartNextPowerIrp@4
; 692 : Irp->IoStatus.Information = 0;
00048 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
0004b c7 40 1c 00 00
00 00 mov DWORD PTR [eax+28], 0
; 693 : Irp->IoStatus.Status = status;
00052 8b 45 f0 mov eax, DWORD PTR _status$[ebp]
00055 8b 4d 0c mov ecx, DWORD PTR _Irp$[ebp]
00058 89 41 18 mov DWORD PTR [ecx+24], eax
; 694 : IoCompleteRequest (Irp, IO_NO_INCREMENT);
0005b 33 d2 xor edx, edx
0005d 8b 4d 0c mov ecx, DWORD PTR _Irp$[ebp]
00060 ff 15 00 00 00
00 call DWORD PTR __imp_@IofCompleteRequest@8
; 695 : return status;
00066 8b 45 f0 mov eax, DWORD PTR _status$[ebp]
00069 e9 4d 02 00 00 jmp $L2914
$L2920:
; 696 : }
; 697 :
; 698 : switch (stack->MinorFunction) {
0006e 8b 45 f8 mov eax, DWORD PTR _stack$[ebp]
00071 33 c9 xor ecx, ecx
00073 8a 48 01 mov cl, BYTE PTR [eax+1]
00076 89 4d dc mov DWORD PTR -36+[ebp], ecx
00079 e9 4a 01 00 00 jmp $L2921
$L2925:
; 699 : case IRP_MN_SET_POWER:
; 700 : Test98_KdPrint(Data,
; 701 : TEST_DBG_PNP_TRACE,
; 702 : ("Test-PnP Setting %s state to %d\n",
; 703 : ((powerType == SystemPowerState) ? "System" : "Device"),
; 704 : powerState.SystemState));
; 705 :
; 706 : switch (powerType) {
0007e 8b 45 ec mov eax, DWORD PTR _powerType$[ebp]
00081 89 45 d8 mov DWORD PTR -40+[ebp], eax
00084 e9 f8 00 00 00 jmp $L2926
$L2930:
; 707 : case DevicePowerState:
; 708 :
; 709 : status = Irp->IoStatus.Status = STATUS_SUCCESS;
00089 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
0008c c7 40 18 00 00
00 00 mov DWORD PTR [eax+24], 0
00093 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00096 8b 40 18 mov eax, DWORD PTR [eax+24]
00099 89 45 f0 mov DWORD PTR _status$[ebp], eax
; 710 :
; 711 : if (Data->DeviceState == powerState.DeviceState) {
0009c 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
0009f 8b 4d fc mov ecx, DWORD PTR _powerState$[ebp]
000a2 39 48 10 cmp DWORD PTR [eax+16], ecx
000a5 0f 85 0a 00 00
00 jne $L2931
; 712 : break;
000ab e9 ea 00 00 00 jmp $L2927
; 713 :
; 714 : } else if (Data->DeviceState < powerState.DeviceState) {
000b0 e9 35 00 00 00 jmp $L2932
$L2931:
000b5 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
000b8 8b 4d fc mov ecx, DWORD PTR _powerState$[ebp]
000bb 39 48 10 cmp DWORD PTR [eax+16], ecx
000be 0f 8d 22 00 00
00 jge $L2933
; 715 : //
; 716 : // Powering down
; 717 : //
; 718 :
; 719 : PoSetPowerState (Data->Self, powerType, powerState);
000c4 8b 45 fc mov eax, DWORD PTR _powerState$[ebp]
000c7 50 push eax
000c8 8b 45 ec mov eax, DWORD PTR _powerType$[ebp]
000cb 50 push eax
000cc 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
000cf 8b 00 mov eax, DWORD PTR [eax]
000d1 50 push eax
000d2 ff 15 00 00 00
00 call DWORD PTR __imp__PoSetPowerState@12
; 720 : Data->DeviceState = powerState.DeviceState;
000d8 8b 45 fc mov eax, DWORD PTR _powerState$[ebp]
000db 8b 4d 08 mov ecx, DWORD PTR _Data$[ebp]
000de 89 41 10 mov DWORD PTR [ecx+16], eax
; 721 :
; 722 : } else {
000e1 e9 04 00 00 00 jmp $L2934
$L2933:
; 723 : //
; 724 : // Powering Up
; 725 : //
; 726 : hookit = TRUE;
000e6 c6 45 f4 01 mov BYTE PTR _hookit$[ebp], 1
$L2934:
$L2932:
; 727 : }
; 728 :
; 729 : break;
000ea e9 ab 00 00 00 jmp $L2927
$L2935:
; 730 :
; 731 : case SystemPowerState:
; 732 : if (Data->PowerQueryLock) {
000ef 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
000f2 33 c9 xor ecx, ecx
000f4 8a 48 19 mov cl, BYTE PTR [eax+25]
000f7 85 c9 test ecx, ecx
000f9 0f 84 0c 00 00
00 je $L2936
; 733 : //
; 734 : // The reception of a power irp resolves the query lock.
; 735 : //
; 736 : Data->PowerQueryLock = FALSE;
000ff 8b 45 08 mov eax, DWORD PTR _Data$[ebp]
00102 c6 40 19 00 mov BYTE PTR [eax+25], 0
; 737 : } else {
00106 e9 00 00 00 00 jmp $L2937
$L2936:
$L2937:
; 738 : ASSERT (Data->SystemState != powerState.SystemState);
; 739 : }
; 740 :
; 741 : status = Irp->IoStatus.Status = STATUS_SUCCESS;
0010b 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
0010e c7 40 18 00 00
00 00 mov DWORD PTR [eax+24], 0
00115 8b 45 0c mov eax, DWORD PTR _Irp$[ebp]
00118 8b 40 18 mov eax, DWORD PTR [eax+24]
0011b 89 45 f0 mov DWORD PTR _status$[ebp], eax
; 742 :
; 743 : i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -