⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initunlo.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 5 页
字号:
  0000e	74 0d		 je	 SHORT $L14867

; 502  :       KeSynchronizeExecution(PDevExt->Interrupt, SerialCleanLists, PDevExt);

  00010	56		 push	 esi
  00011	68 00 00 00 00	 push	 OFFSET FLAT:_SerialCleanLists@4
  00016	50		 push	 eax
  00017	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__KeSynchronizeExecution@12
$L14867:

; 503  :    }
; 504  : 
; 505  :    //
; 506  :    // SerialCleanLists can remove our interrupt from us...
; 507  :    //
; 508  : 
; 509  :    if (PDevExt->Interrupt != NULL) {

  0001d	8b 86 a0 00 00
	00		 mov	 eax, DWORD PTR [esi+160]
  00023	53		 push	 ebx
  00024	8b 1d 00 00 00
	00		 mov	 ebx, DWORD PTR __imp__ExFreePool@4
  0002a	85 c0		 test	 eax, eax
  0002c	74 20		 je	 SHORT $L14875

; 510  :       //
; 511  :       // Stop servicing interrupts if we are the owner
; 512  :       //
; 513  : 
; 514  :       SerialDump(SERPNPPOWER,
; 515  :                  ("SERIAL: Release - disconnecting interrupt %08X\n",
; 516  :                   PDevExt->Interrupt));
; 517  : 
; 518  :       IoDisconnectInterrupt(PDevExt->Interrupt);

  0002e	50		 push	 eax
  0002f	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoDisconnectInterrupt@4

; 519  :       PDevExt->Interrupt = NULL;

  00035	83 a6 a0 00 00
	00 00		 and	 DWORD PTR [esi+160], 0

; 520  : 
; 521  :       if (PDevExt->CIsrSw != NULL) {

  0003c	8d be c4 04 00
	00		 lea	 edi, DWORD PTR [esi+1220]
  00042	8b 07		 mov	 eax, DWORD PTR [edi]
  00044	85 c0		 test	 eax, eax
  00046	74 06		 je	 SHORT $L14875

; 522  :          ExFreePool(PDevExt->CIsrSw);

  00048	50		 push	 eax
  00049	ff d3		 call	 ebx

; 523  :          PDevExt->CIsrSw = NULL;

  0004b	83 27 00	 and	 DWORD PTR [edi], 0
$L14875:

; 524  :       }
; 525  :    }
; 526  : 
; 527  :    if (PDevExt->PortOnAMultiportCard) {

  0004e	80 be a3 01 00
	00 00		 cmp	 BYTE PTR [esi+419], 0
  00055	74 21		 je	 SHORT $L14885
  00057	8b 86 94 00 00
	00		 mov	 eax, DWORD PTR [esi+148]

; 528  :        ULONG i;
; 529  : 
; 530  :        //
; 531  :        // If we are the last device, free this memory
; 532  :        //
; 533  : 
; 534  :        for (i = 0; i < SERIAL_MAX_PORTS_INDEXED; i++) {

  0005d	33 d2		 xor	 edx, edx
  0005f	8d 48 04	 lea	 ecx, DWORD PTR [eax+4]
$L14879:

; 535  :           if (((PSERIAL_MULTIPORT_DISPATCH)PDevExt->OurIsrContext)
; 536  :               ->Extensions[i] != NULL) {

  00062	83 39 00	 cmp	 DWORD PTR [ecx], 0
  00065	75 09		 jne	 SHORT $L15855
  00067	42		 inc	 edx
  00068	83 c1 04	 add	 ecx, 4
  0006b	83 fa 10	 cmp	 edx, 16			; 00000010H
  0006e	72 f2		 jb	 SHORT $L14879
$L15855:

; 537  :              break;
; 538  :           }
; 539  :        }
; 540  : 
; 541  :        if (i == SERIAL_MAX_PORTS_INDEXED) {

  00070	83 fa 10	 cmp	 edx, 16			; 00000010H
  00073	75 03		 jne	 SHORT $L14885

; 542  :           SerialDump(SERPNPPOWER,("SERIAL: Release - freeing multi context\n"));
; 543  :           ExFreePool(PDevExt->OurIsrContext);

  00075	50		 push	 eax
  00076	ff d3		 call	 ebx
$L14885:

; 544  :        }
; 545  :     }
; 546  : 
; 547  : 
; 548  :    //
; 549  :    // Stop handling timers
; 550  :    //
; 551  : 
; 552  :    SerialCancelTimer(&PDevExt->ReadRequestTotalTimer, PDevExt);

  00078	8d 86 b0 03 00
	00		 lea	 eax, DWORD PTR [esi+944]
  0007e	56		 push	 esi
  0007f	50		 push	 eax
  00080	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 553  :    SerialCancelTimer(&PDevExt->ReadRequestIntervalTimer, PDevExt);

  00085	8d 86 d8 03 00
	00		 lea	 eax, DWORD PTR [esi+984]
  0008b	56		 push	 esi
  0008c	50		 push	 eax
  0008d	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 554  :    SerialCancelTimer(&PDevExt->WriteRequestTotalTimer, PDevExt);

  00092	8d 86 00 04 00
	00		 lea	 eax, DWORD PTR [esi+1024]
  00098	56		 push	 esi
  00099	50		 push	 eax
  0009a	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 555  :    SerialCancelTimer(&PDevExt->ImmediateTotalTimer, PDevExt);

  0009f	8d 86 28 04 00
	00		 lea	 eax, DWORD PTR [esi+1064]
  000a5	56		 push	 esi
  000a6	50		 push	 eax
  000a7	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 556  :    SerialCancelTimer(&PDevExt->XoffCountTimer, PDevExt);

  000ac	8d 86 50 04 00
	00		 lea	 eax, DWORD PTR [esi+1104]
  000b2	56		 push	 esi
  000b3	50		 push	 eax
  000b4	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 557  :    SerialCancelTimer(&PDevExt->LowerRTSTimer, PDevExt);

  000b9	8d 86 78 04 00
	00		 lea	 eax, DWORD PTR [esi+1144]
  000bf	56		 push	 esi
  000c0	50		 push	 eax
  000c1	e8 00 00 00 00	 call	 _SerialCancelTimer@8

; 558  : 
; 559  :    //
; 560  :    // Stop servicing DPC's
; 561  :    //
; 562  : 
; 563  :    SerialRemoveQueueDpc(&PDevExt->CompleteWriteDpc, PDevExt);

  000c6	8b 3d 00 00 00
	00		 mov	 edi, DWORD PTR __imp__KeRemoveQueueDpc@4
  000cc	8d 86 ec 01 00
	00		 lea	 eax, DWORD PTR [esi+492]
  000d2	50		 push	 eax
  000d3	ff d7		 call	 edi
  000d5	8b 1d 00 00 00
	00		 mov	 ebx, DWORD PTR __imp_@InterlockedDecrement@4
  000db	84 c0		 test	 al, al
  000dd	74 08		 je	 SHORT $L14889
  000df	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  000e5	ff d3		 call	 ebx
$L14889:

; 564  :    SerialRemoveQueueDpc(&PDevExt->CompleteReadDpc, PDevExt);

  000e7	8d 86 0c 02 00
	00		 lea	 eax, DWORD PTR [esi+524]
  000ed	50		 push	 eax
  000ee	ff d7		 call	 edi
  000f0	84 c0		 test	 al, al
  000f2	74 08		 je	 SHORT $L14890
  000f4	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  000fa	ff d3		 call	 ebx
$L14890:

; 565  :    SerialRemoveQueueDpc(&PDevExt->TotalReadTimeoutDpc, PDevExt);

  000fc	8d 86 2c 02 00
	00		 lea	 eax, DWORD PTR [esi+556]
  00102	50		 push	 eax
  00103	ff d7		 call	 edi
  00105	84 c0		 test	 al, al
  00107	74 08		 je	 SHORT $L14891
  00109	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  0010f	ff d3		 call	 ebx
$L14891:

; 566  :    SerialRemoveQueueDpc(&PDevExt->IntervalReadTimeoutDpc, PDevExt);

  00111	8d 86 4c 02 00
	00		 lea	 eax, DWORD PTR [esi+588]
  00117	50		 push	 eax
  00118	ff d7		 call	 edi
  0011a	84 c0		 test	 al, al
  0011c	74 08		 je	 SHORT $L14892
  0011e	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  00124	ff d3		 call	 ebx
$L14892:

; 567  :    SerialRemoveQueueDpc(&PDevExt->TotalWriteTimeoutDpc, PDevExt);

  00126	8d 86 6c 02 00
	00		 lea	 eax, DWORD PTR [esi+620]
  0012c	50		 push	 eax
  0012d	ff d7		 call	 edi
  0012f	84 c0		 test	 al, al
  00131	74 08		 je	 SHORT $L14893
  00133	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  00139	ff d3		 call	 ebx
$L14893:

; 568  :    SerialRemoveQueueDpc(&PDevExt->CommErrorDpc, PDevExt);

  0013b	8d 86 8c 02 00
	00		 lea	 eax, DWORD PTR [esi+652]
  00141	50		 push	 eax
  00142	ff d7		 call	 edi
  00144	84 c0		 test	 al, al
  00146	74 08		 je	 SHORT $L14894
  00148	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  0014e	ff d3		 call	 ebx
$L14894:

; 569  :    SerialRemoveQueueDpc(&PDevExt->CompleteImmediateDpc, PDevExt);

  00150	8d 86 cc 02 00
	00		 lea	 eax, DWORD PTR [esi+716]
  00156	50		 push	 eax
  00157	ff d7		 call	 edi
  00159	84 c0		 test	 al, al
  0015b	74 08		 je	 SHORT $L14895
  0015d	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  00163	ff d3		 call	 ebx
$L14895:

; 570  :    SerialRemoveQueueDpc(&PDevExt->TotalImmediateTimeoutDpc, PDevExt);

  00165	8d 86 ec 02 00
	00		 lea	 eax, DWORD PTR [esi+748]
  0016b	50		 push	 eax
  0016c	ff d7		 call	 edi
  0016e	84 c0		 test	 al, al
  00170	74 08		 je	 SHORT $L14896
  00172	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  00178	ff d3		 call	 ebx
$L14896:

; 571  :    SerialRemoveQueueDpc(&PDevExt->CommWaitDpc, PDevExt);

  0017a	8d 86 ac 02 00
	00		 lea	 eax, DWORD PTR [esi+684]
  00180	50		 push	 eax
  00181	ff d7		 call	 edi
  00183	84 c0		 test	 al, al
  00185	74 08		 je	 SHORT $L14897
  00187	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  0018d	ff d3		 call	 ebx
$L14897:

; 572  :    SerialRemoveQueueDpc(&PDevExt->XoffCountTimeoutDpc, PDevExt);

  0018f	8d 86 0c 03 00
	00		 lea	 eax, DWORD PTR [esi+780]
  00195	50		 push	 eax
  00196	ff d7		 call	 edi
  00198	84 c0		 test	 al, al
  0019a	74 08		 je	 SHORT $L14898
  0019c	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  001a2	ff d3		 call	 ebx
$L14898:

; 573  :    SerialRemoveQueueDpc(&PDevExt->XoffCountCompleteDpc, PDevExt);

  001a4	8d 86 2c 03 00
	00		 lea	 eax, DWORD PTR [esi+812]
  001aa	50		 push	 eax
  001ab	ff d7		 call	 edi
  001ad	84 c0		 test	 al, al
  001af	74 08		 je	 SHORT $L14899
  001b1	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  001b7	ff d3		 call	 ebx
$L14899:

; 574  :    SerialRemoveQueueDpc(&PDevExt->StartTimerLowerRTSDpc, PDevExt);

  001b9	8d 86 4c 03 00
	00		 lea	 eax, DWORD PTR [esi+844]
  001bf	50		 push	 eax
  001c0	ff d7		 call	 edi
  001c2	84 c0		 test	 al, al
  001c4	74 08		 je	 SHORT $L14900
  001c6	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  001cc	ff d3		 call	 ebx
$L14900:

; 575  :    SerialRemoveQueueDpc(&PDevExt->PerhapsLowerRTSDpc, PDevExt);

  001ce	8d 86 6c 03 00
	00		 lea	 eax, DWORD PTR [esi+876]
  001d4	50		 push	 eax
  001d5	ff d7		 call	 edi
  001d7	84 c0		 test	 al, al
  001d9	74 08		 je	 SHORT $L14901
  001db	8d 8e 30 06 00
	00		 lea	 ecx, DWORD PTR [esi+1584]
  001e1	ff d3		 call	 ebx
$L14901:

; 576  : 
; 577  : 
; 578  : 
; 579  :    //
; 580  :    // If necessary, unmap the device registers.
; 581  :    //
; 582  : 
; 583  :    if (PDevExt->UnMapRegisters) {

  001e3	80 be 9e 01 00
	00 00		 cmp	 BYTE PTR [esi+414], 0
  001ea	8b 3d 00 00 00
	00		 mov	 edi, DWORD PTR __imp__MmUnmapIoSpace@8
  001f0	5b		 pop	 ebx
  001f1	74 0e		 je	 SHORT $L14902

; 584  :       MmUnmapIoSpace(PDevExt->Controller, PDevExt->SpanOfController);

  001f3	ff b6 44 01 00
	00		 push	 DWORD PTR [esi+324]
  001f9	ff b6 98 00 00
	00		 push	 DWORD PTR [esi+152]
  001ff	ff d7		 call	 edi
$L14902:

; 585  :    }
; 586  : 
; 587  :    if (PDevExt->UnMapStatus) {

  00201	80 be 9f 01 00
	00 00		 cmp	 BYTE PTR [esi+415], 0
  00208	74 0e		 je	 SHORT $L14904

; 588  :       MmUnmapIoSpace(PDevExt->InterruptStatus,
; 589  :                      PDevExt->SpanOfInterruptStatus);

  0020a	ff b6 48 01 00
	00		 push	 DWORD PTR [esi+328]
  00210	ff b6 9c 00 00
	00		 push	 DWORD PTR [esi+156]
  00216	ff d7		 call	 edi
$L14904:
  00218	5f		 pop	 edi
  00219	5e		 pop	 esi

; 590  :    }
; 591  : 
; 592  :    SerialDump(SERTRACECALLS,("SERIAL: Leave SerialReleaseResources\n"));
; 593  : }

  0021a	c2 04 00	 ret	 4
_SerialReleaseResources@4 ENDP
PAGESRP0	ENDS
PUBLIC	_SerialKillPendingIrps@4
PUBLIC	_SerialPrepareRemove@4
EXTRN	__imp__KeWaitForSingleObject@20:NEAR
EXTRN	__imp__PoSetPowerState@12:NEAR
EXTRN	_SerialSetDeviceFlags@16:NEAR
; Function compile flags: /Ogsy
;	COMDAT _SerialPrepareRemove@4
_TEXT	SEGMENT
_PDevObj$ = 8
_SerialPrepareRemove@4 PROC NEAR			; COMDAT

; 614  : {

  00000	56		 push	 esi
  00001	57		 push	 edi

; 615  :    PSERIAL_DEVICE_EXTENSION pDevExt
; 616  :       = (PSERIAL_DEVICE_EXTENSION)PDevObj->DeviceExtension;

  00002	8b 7c 24 0c	 mov	 edi, DWORD PTR _PDevObj$[esp+4]

; 617  :    POWER_STATE state;
; 618  :    ULONG pendingIRPs;
; 619  : 
; 620  :    PAGED_CODE();
; 621  : 
; 622  :    SerialDump(SERTRACECALLS,("SERIAL: Enter SerialPrepareRemove\n"));
; 623  : 
; 624  :    //
; 625  :    // Mark as not accepting requests
; 626  :    //
; 627  : 
; 628  :    SerialSetAccept(pDevExt, SERIAL_PNPACCEPT_REMOVING);

  00006	6a 01		 push	 1
  00008	6a 01		 push	 1
  0000a	8b 77 28	 mov	 esi, DWORD PTR [edi+40]
  0000d	8d 86 cc 04 00
	00		 lea	 eax, DWORD PTR [esi+1228]
  00013	50		 push	 eax
  00014	56		 push	 esi
  00015	e8 00 00 00 00	 call	 _SerialSetDeviceFlags@16

; 629  : 
; 630  :    //
; 631  :    // Complete all pending requests
; 632  :    //
; 633  : 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -