📄 pcidp.cod
字号:
; 694 : //MemoryBase[0x1C53]++;
; 695 :
; 696 : //Service all of the recorded interrupts by checking to see if the interrupt
; 697 : //type has been registered by the user.
; 698 : while(IntData->QueNew != IntData->QueNext){
000ad 8a 46 25 mov al, BYTE PTR [esi+37]
000b0 3a 46 24 cmp al, BYTE PTR [esi+36]
000b3 0f 85 63 ff ff
ff jne $L8595
000b9 5b pop ebx
$L8596:
000ba 5e pop esi
; 732 : }
; 733 : }
000bb c9 leave
000bc c2 10 00 ret 16 ; 00000010H
_PCIDPForDpcIsr@16 ENDP
_TEXT ENDS
PUBLIC _PCIDPISR@8
EXTRN __imp__KeInsertQueueDpc@12:NEAR
; COMDAT _PCIDPISR@8
_TEXT SEGMENT
_Context$ = 12
_PCIDPISR@8 PROC NEAR ; COMDAT
; 744 : // Define variables.
; 745 : BOOLEAN Status;
; 746 : PDEVICE_OBJECT DeviceObject;
; 747 : PPCIDP_EXTENSION ObjExt;
; 748 : PINTERRUPT_DATA IntData;
; 749 : PULONG MemoryBase;
; 750 : ULONG HINTStatusReg;
; 751 :
; 752 : // Check the masked HINT for an active interrupt. If it's not set,
; 753 : // the PCIDP card did not cause the interrupt, so exit quick.
; 754 : DeviceObject = (PDEVICE_OBJECT)Context;
; 755 : ObjExt = (PPCIDP_EXTENSION)DeviceObject->DeviceExtension;
00000 8b 44 24 08 mov eax, DWORD PTR _Context$[esp-4]
00004 56 push esi
00005 8b 40 28 mov eax, DWORD PTR [eax+40]
; 756 : MemoryBase = ObjExt->MemoryBase;
00008 8b 70 18 mov esi, DWORD PTR [eax+24]
; 757 :
; 758 : // Debug
; 759 : //MemoryBase[0x1C50]++;
; 760 :
; 761 : HINTStatusReg = MemoryBase[HINT] & 0x03FF;
0000b 8b 96 e4 04 00
00 mov edx, DWORD PTR [esi+1252]
00011 81 e2 ff 03 00
00 and edx, 1023 ; 000003ffH
; 762 : if(HINTStatusReg == 0){
00017 75 07 jne SHORT $L8626
; 763 :
; 764 : // Debug
; 765 : //MemoryBase[0x1C51]++;
; 766 :
; 767 : Status = FALSE;
00019 32 c0 xor al, al
; 768 : goto ExitA;
0001b e9 e1 00 00 00 jmp $ExitA$8627
$L8626:
00020 53 push ebx
00021 57 push edi
; 769 : }
; 770 :
; 771 : // Initialize variables.
; 772 : DeviceObject = (PDEVICE_OBJECT)Context;
; 773 : IntData = &ObjExt->InterruptData;
; 774 :
; 775 : // This board caused the interrupt. Now determine what type of interrupt
; 776 : // was triggered.
; 777 : if(HINTStatusReg & PCIMasterAbort){
00022 b9 00 02 00 00 mov ecx, 512 ; 00000200H
00027 6a 10 push 16 ; 00000010H
00029 85 d1 test edx, ecx
0002b 5b pop ebx
0002c 74 14 je SHORT $L8630
; 778 : IntData->Type[IntData->QueNext] = PCIMasterAbort;
0002e 0f b6 78 24 movzx edi, BYTE PTR [eax+36]
00032 89 4c b8 28 mov DWORD PTR [eax+edi*4+40], ecx
; 779 : IntData->QueNext++;
00036 fe 40 24 inc BYTE PTR [eax+36]
; 780 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
00039 38 58 24 cmp BYTE PTR [eax+36], bl
0003c 75 04 jne SHORT $L8630
0003e 80 60 24 00 and BYTE PTR [eax+36], 0
$L8630:
; 781 : }
; 782 :
; 783 : if(HINTStatusReg & PCITargetAbort){
00042 b9 00 01 00 00 mov ecx, 256 ; 00000100H
00047 85 d1 test edx, ecx
00049 74 14 je SHORT $L8632
; 784 : IntData->Type[IntData->QueNext] = PCITargetAbort;
0004b 0f b6 78 24 movzx edi, BYTE PTR [eax+36]
0004f 89 4c b8 28 mov DWORD PTR [eax+edi*4+40], ecx
; 785 : IntData->QueNext++;
00053 fe 40 24 inc BYTE PTR [eax+36]
; 786 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
00056 38 58 24 cmp BYTE PTR [eax+36], bl
00059 75 04 jne SHORT $L8632
0005b 80 60 24 00 and BYTE PTR [eax+36], 0
$L8632:
; 787 : }
; 788 :
; 789 : if(HINTStatusReg & I2OOutboundPostFIFONotEmpty){
0005f f6 c2 80 test dl, 128 ; 00000080H
00062 74 18 je SHORT $L8634
; 790 : IntData->Type[IntData->QueNext] = I2OOutboundPostFIFONotEmpty;
00064 0f b6 48 24 movzx ecx, BYTE PTR [eax+36]
00068 c7 44 88 28 80
00 00 00 mov DWORD PTR [eax+ecx*4+40], 128 ; 00000080H
; 791 : IntData->QueNext++;
00070 fe 40 24 inc BYTE PTR [eax+36]
; 792 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
00073 38 58 24 cmp BYTE PTR [eax+36], bl
00076 75 04 jne SHORT $L8634
00078 80 60 24 00 and BYTE PTR [eax+36], 0
$L8634:
; 793 : }
; 794 :
; 795 : if(HINTStatusReg & DMAComplete){
0007c 6a 20 push 32 ; 00000020H
0007e 59 pop ecx
0007f 84 d1 test dl, cl
00081 74 14 je SHORT $L8636
; 796 : IntData->Type[IntData->QueNext] = DMAComplete;
00083 0f b6 78 24 movzx edi, BYTE PTR [eax+36]
00087 89 4c b8 28 mov DWORD PTR [eax+edi*4+40], ecx
; 797 : IntData->QueNext++;
0008b fe 40 24 inc BYTE PTR [eax+36]
; 798 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
0008e 38 58 24 cmp BYTE PTR [eax+36], bl
00091 75 04 jne SHORT $L8636
00093 80 60 24 00 and BYTE PTR [eax+36], 0
$L8636:
; 799 :
; 800 : // Debug
; 801 : //MemoryBase[0x1C52]++;
; 802 :
; 803 : }
; 804 :
; 805 : if(HINTStatusReg & LocalToHostExternalSignal){
00097 84 d3 test dl, bl
00099 74 14 je SHORT $L8638
; 806 : IntData->Type[IntData->QueNext] = LocalToHostExternalSignal;
0009b 0f b6 48 24 movzx ecx, BYTE PTR [eax+36]
0009f 89 5c 88 28 mov DWORD PTR [eax+ecx*4+40], ebx
; 807 : IntData->QueNext++;
000a3 fe 40 24 inc BYTE PTR [eax+36]
; 808 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
000a6 38 58 24 cmp BYTE PTR [eax+36], bl
000a9 75 04 jne SHORT $L8638
000ab 80 60 24 00 and BYTE PTR [eax+36], 0
$L8638:
; 809 : }
; 810 :
; 811 : if(HINTStatusReg & LocalToHostMailbox){
000af 6a 08 push 8
000b1 59 pop ecx
000b2 84 d1 test dl, cl
000b4 74 14 je SHORT $L8640
; 812 : IntData->Type[IntData->QueNext] = LocalToHostMailbox;
000b6 0f b6 78 24 movzx edi, BYTE PTR [eax+36]
000ba 89 4c b8 28 mov DWORD PTR [eax+edi*4+40], ecx
; 813 : IntData->QueNext++;
000be fe 40 24 inc BYTE PTR [eax+36]
; 814 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
000c1 38 58 24 cmp BYTE PTR [eax+36], bl
000c4 75 04 jne SHORT $L8640
000c6 80 60 24 00 and BYTE PTR [eax+36], 0
$L8640:
; 815 : }
; 816 :
; 817 : if(HINTStatusReg & I2OPCIFIFOOverflow){
000ca 6a 02 push 2
000cc 59 pop ecx
000cd 84 d1 test dl, cl
000cf 74 14 je SHORT $L8642
; 818 : IntData->Type[IntData->QueNext] = I2OPCIFIFOOverflow;
000d1 0f b6 78 24 movzx edi, BYTE PTR [eax+36]
000d5 89 4c b8 28 mov DWORD PTR [eax+edi*4+40], ecx
; 819 : IntData->QueNext++;
000d9 fe 40 24 inc BYTE PTR [eax+36]
; 820 : if(IntData->QueNext == InterruptQueSize) IntData->QueNext = 0;
000dc 38 58 24 cmp BYTE PTR [eax+36], bl
000df 75 04 jne SHORT $L8642
000e1 80 60 24 00 and BYTE PTR [eax+36], 0
$L8642:
; 821 : }
; 822 :
; 823 : // Clear all set interrupts as indicated in the status part of the
; 824 : // HINT register while preserving the enabled part of the HINT. This
; 825 : // is done by writing a 1 to each active bit which just happens to
; 826 : // be value in HINTStatusReg.
; 827 : MemoryBase[HINT] |= HINTStatusReg;
; 828 :
; 829 : // Lastly, request the defered interrupt handler be queued for processing.
; 830 : IoRequestDpc(DeviceObject, NULL, NULL);
000e5 8b 44 24 14 mov eax, DWORD PTR _Context$[esp+8]
000e9 09 96 e4 04 00
00 or DWORD PTR [esi+1252], edx
000ef 6a 00 push 0
000f1 83 c0 74 add eax, 116 ; 00000074H
000f4 6a 00 push 0
000f6 50 push eax
000f7 ff 15 00 00 00
00 call DWORD PTR __imp__KeInsertQueueDpc@12
000fd 5f pop edi
; 831 : Status = TRUE;
000fe b0 01 mov al, 1
00100 5b pop ebx
$ExitA$8627:
00101 5e pop esi
; 832 :
; 833 : ExitA:
; 834 : return Status;
; 835 : }
00102 c2 08 00 ret 8
_PCIDPISR@8 ENDP
_TEXT ENDS
PUBLIC _PCIDPCancelMapDMARoutine@8
EXTRN __imp__MmUnmapLockedPages@8:NEAR
; COMDAT _PCIDPCancelMapDMARoutine@8
_TEXT SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_Interrupt$ = -4
_CurrentLink$ = 8
_FirstLink$ = -8
_PCIDPCancelMapDMARoutine@8 PROC NEAR ; COMDAT
; 846 : ){
00000 55 push ebp
00001 8b ec mov ebp, esp
00003 51 push ecx
00004 51 push ecx
; 847 : // Define variables.
; 848 : PPCIDP_EXTENSION ObjExt;
; 849 : PREGISTERED_INTERRUPT Interrupt;
; 850 : PLINKED_LIST CurrentLink;
; 851 : PLINKED_LIST FirstLink;
; 852 :
; 853 : // Debug entry point
; 854 : //DbgPrint("[PCIDP]->Entering CancelMapDMARoutine...\n"); //debug
; 855 : //DbgBreakPoint(); //debug
; 856 :
; 857 : // Initialize variables.
; 858 : ObjExt = (PPCIDP_EXTENSION)DeviceObject->DeviceExtension;
00005 8b 45 08 mov eax, DWORD PTR _DeviceObject$[ebp]
00008 56 push esi
00009 57 push edi
; 859 :
; 860 : //ObjExt->MemoryBase[0x1C5B]++; //debug
; 861 :
; 862 : // Search the driver's events linked list for an entry containing the
; 863 : // user provided Irp.
; 864 : CurrentLink = NULL;
0000a 83 65 08 00 and DWORD PTR _CurrentLink$[ebp], 0
0000e 8b 70 28 mov esi, DWORD PTR [eax+40]
; 865 : FirstLink = NULL;
; 866 : while(GetNextEntry(ObjExt, &FirstLink, &CurrentLink, &Interrupt) == TRUE){
00011 8d 45 fc lea eax, DWORD PTR _Interrupt$[ebp]
00014 83 65 f8 00 and DWORD PTR _FirstLink$[ebp], 0
00018 50 push eax
00019 8d 45 08 lea eax, DWORD PTR _CurrentLink$[ebp]
0001c 50 push eax
0001d 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
00020 50 push eax
00021 56 push esi
00022 e8 00 00 00 00 call _GetNextEntry@16
00027 8b 7d 0c mov edi, DWORD PTR _Irp$[ebp]
0002a 3c 01 cmp al, 1
0002c 75 44 jne SHORT $L8661
$L8658:
; 867 :
; 868 : //ObjExt->MemoryBase[0x1C5C]++; //debug
; 869 :
; 870 : // Delete its linked list entry and unmap from DMA space.
; 871 : if(Irp == Interrupt->Irp){
0002e 8b 45 fc mov eax, DWORD PTR _Interrupt$[ebp]
; 875 : }
; 876 :
; 877 : //ObjExt->MemoryBase[0x1C5D]++; //debug
; 878 :
; 879 : break;
; 880 : }
; 881 : else
; 882 : PutBackEntry(ObjExt, CurrentLink);
00031 ff 75 08 push DWORD PTR _CurrentLink$[ebp]
00034 3b 78 04 cmp edi, DWORD PTR [eax+4]
00037 56 push esi
00038 74 1d je SHORT $L8755
0003a e8 00 00 00 00 call _PutBackEntry@8
0003f 8d 45 fc lea eax, DWORD PTR _Interrupt$[ebp]
00042 50 push eax
00043 8d 45 08 lea eax, DWORD PTR _CurrentLink$[ebp]
00046 50 push eax
00047 8d 45 f8 lea eax, DWORD PTR _FirstLink$[ebp]
0004a 50 push eax
0004b 56 push esi
0004c e8 00 00 00 00 call _GetNextEntry@16
00051 3c 01 cmp al, 1
00053 74 d9 je SHORT $L8658
; 867 :
; 868 : //ObjExt->MemoryBase[0x1C5C]++; //debug
; 869 :
; 870 : // Delete its linked list entry and unmap from DMA space.
; 871 : if(Irp == Interrupt->Irp){
00055 eb 1b jmp SHORT $L8661
$L8755:
; 872 : FreeEntry(ObjExt, CurrentLink);
00057 e8 00 00 00 00 call _FreeEntry@8
; 873 : if(ObjExt->MDL){
0005c 8b b6 80 00 00
00 mov esi, DWORD PTR [esi+128]
00062 85 f6 test esi, esi
00064 74 0c je SHORT $L8661
; 874 : MmUnmapLockedPages((PVOID)Interrupt->Type, ObjExt->MDL); //linear address in Type
00066 8b 45 fc mov eax, DWORD PTR _Interrupt$[ebp]
00069 56 push esi
0006a ff 30 push DWORD PTR [eax]
0006c ff 15 00 00 00
00 call DWORD PTR __imp__MmUnmapLockedPages@8
$L8661:
; 883 : }
; 884 :
; 885 : IoReleaseCancelSpinLock (Irp->CancelIrql);
00072 8a 47 25 mov al, BYTE PTR [edi+37]
00075 50 push eax
00076 ff 15 00 00 00
00 call DWORD PTR __imp__IoReleaseCancelSpinLock@4
; 886 : Irp->IoStatus.Information = 0;
0007c 83 67 1c 00 and DWORD PTR [edi+28], 0
; 887 : Irp->IoStatus.Status = STATUS_CANCELLED;
; 888 : IoCompleteRequest(Irp, IO_NO_INCREMENT) ;
00080 32 d2 xor dl, dl
00082 8b cf mov ecx, edi
00084 c7 47 18 20 01
00 c0 mov DWORD PTR [edi+24], -1073741536 ; c0000120H
0008b ff 15 00 00
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -