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

📄 initunlo.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 5 页
字号:
$L14939:

; 409  :          InsertTailList(&pDevExt->TopLevelSharers, &pNewRoot->TopLevelSharers);

  00222	8b 4f 04	 mov	 ecx, DWORD PTR [edi+4]
  00225	89 3b		 mov	 DWORD PTR [ebx], edi
  00227	89 48 0c	 mov	 DWORD PTR [eax+12], ecx
  0022a	89 19		 mov	 DWORD PTR [ecx], ebx
  0022c	89 5f 04	 mov	 DWORD PTR [edi+4], ebx
$L14920:

; 410  : 
; 411  :       }
; 412  : 
; 413  :       //
; 414  :       // Remove ourselves
; 415  :       //
; 416  : 
; 417  :       RemoveEntryList(&pDevExt->TopLevelSharers);

  0022f	8b 4e 0c	 mov	 ecx, DWORD PTR [esi+12]
  00232	8b 07		 mov	 eax, DWORD PTR [edi]
  00234	5b		 pop	 ebx
  00235	89 01		 mov	 DWORD PTR [ecx], eax
  00237	89 48 04	 mov	 DWORD PTR [eax+4], ecx

; 418  :       InitializeListHead(&pDevExt->TopLevelSharers);
; 419  : 
; 420  :       //
; 421  :       // Now check the master list to see if anyone is left...
; 422  :       //
; 423  : 
; 424  :       if (!IsListEmpty(&pDevExt->CIsrSw->SharerList)) {

  0023a	8b 86 c4 04 00
	00		 mov	 eax, DWORD PTR [esi+1220]
  00240	89 7e 0c	 mov	 DWORD PTR [esi+12], edi
  00243	83 c0 08	 add	 eax, 8
  00246	89 3f		 mov	 DWORD PTR [edi], edi
  00248	39 00		 cmp	 DWORD PTR [eax], eax
  0024a	74 07		 je	 SHORT $L14947

; 425  :          //
; 426  :          // Others are chained on this interrupt, so we don't want to
; 427  :          // disconnect it.
; 428  :          //
; 429  : 
; 430  :          pDevExt->Interrupt = NULL;

  0024c	83 a6 a0 00 00
	00 00		 and	 DWORD PTR [esi+160], 0
$L14947:

; 431  :       }
; 432  :    }
; 433  : 
; 434  :    //
; 435  :    // If this is part of a multiport board and we still have
; 436  :    // siblings, remove us from that list
; 437  :    //
; 438  : 
; 439  :    if (!IsListEmpty(&pDevExt->MultiportSiblings)) {

  00253	8d 7e 18	 lea	 edi, DWORD PTR [esi+24]
  00256	39 3f		 cmp	 DWORD PTR [edi], edi
  00258	74 23		 je	 SHORT $L14949

; 440  :       SerialDump(SERPNPPOWER,("SERIAL: CLEAN: Has multiport siblings\n"));

  0025a	f6 05 01 00 00
	00 01		 test	 BYTE PTR _SerialDebugLevel+1, 1
  00261	74 0b		 je	 SHORT $L14951
  00263	68 00 00 00 00	 push	 OFFSET FLAT:$SG14956
  00268	e8 00 00 00 00	 call	 _DbgPrint
  0026d	59		 pop	 ecx
$L14951:

; 441  :       RemoveEntryList(&pDevExt->MultiportSiblings);

  0026e	8b 4e 1c	 mov	 ecx, DWORD PTR [esi+28]
  00271	8b 07		 mov	 eax, DWORD PTR [edi]
  00273	89 01		 mov	 DWORD PTR [ecx], eax
  00275	89 48 04	 mov	 DWORD PTR [eax+4], ecx

; 442  :       InitializeListHead(&pDevExt->MultiportSiblings);

  00278	89 7e 1c	 mov	 DWORD PTR [esi+28], edi
  0027b	89 3f		 mov	 DWORD PTR [edi], edi
$L14949:

; 443  :    }
; 444  : 
; 445  : 
; 446  :    if (!IsListEmpty(&pDevExt->CommonInterruptObject)) {

  0027d	8d 7e 10	 lea	 edi, DWORD PTR [esi+16]
  00280	39 3f		 cmp	 DWORD PTR [edi], edi
  00282	74 2a		 je	 SHORT $L14965

; 447  : 
; 448  :       SerialDump(SERPNPPOWER,("SERIAL: CLEAN: Common intobj member\n"));

  00284	f6 05 01 00 00
	00 01		 test	 BYTE PTR _SerialDebugLevel+1, 1
  0028b	74 0b		 je	 SHORT $L14967
  0028d	68 00 00 00 00	 push	 OFFSET FLAT:$SG14972
  00292	e8 00 00 00 00	 call	 _DbgPrint
  00297	59		 pop	 ecx
$L14967:

; 449  : 
; 450  :       RemoveEntryList(&pDevExt->CommonInterruptObject);

  00298	8b 4e 14	 mov	 ecx, DWORD PTR [esi+20]
  0029b	8b 07		 mov	 eax, DWORD PTR [edi]
  0029d	89 01		 mov	 DWORD PTR [ecx], eax
  0029f	89 48 04	 mov	 DWORD PTR [eax+4], ecx

; 451  :       InitializeListHead(&pDevExt->CommonInterruptObject);
; 452  : 
; 453  :       //
; 454  :       // Others are sharing this interrupt object so we detach ourselves
; 455  :       // from it this way instead of disconnecting.
; 456  :       //
; 457  : 
; 458  :       pDevExt->Interrupt = NULL;

  002a2	83 a6 a0 00 00
	00 00		 and	 DWORD PTR [esi+160], 0
  002a9	89 7e 14	 mov	 DWORD PTR [esi+20], edi
  002ac	89 3f		 mov	 DWORD PTR [edi], edi
$L14965:

; 459  :    }
; 460  : 
; 461  :    //
; 462  :    // AllDevObjs should never be empty since we have a sentinal
; 463  :    //
; 464  : 
; 465  :    ASSERT(!IsListEmpty(&pDevExt->AllDevObjs));

  002ae	8d 7e 20	 lea	 edi, DWORD PTR [esi+32]
  002b1	39 3f		 cmp	 DWORD PTR [edi], edi
  002b3	75 17		 jne	 SHORT $L14982
  002b5	6a 00		 push	 0
  002b7	68 d1 01 00 00	 push	 465			; 000001d1H
  002bc	68 00 00 00 00	 push	 OFFSET FLAT:$SG14984
  002c1	68 00 00 00 00	 push	 OFFSET FLAT:$SG14985
  002c6	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L14982:

; 466  : 
; 467  :    RemoveEntryList(&pDevExt->AllDevObjs);

  002cc	8b 4e 24	 mov	 ecx, DWORD PTR [esi+36]
  002cf	8b 07		 mov	 eax, DWORD PTR [edi]
  002d1	89 01		 mov	 DWORD PTR [ecx], eax
  002d3	89 48 04	 mov	 DWORD PTR [eax+4], ecx

; 468  :    InitializeListHead(&pDevExt->AllDevObjs);

  002d6	89 7e 24	 mov	 DWORD PTR [esi+36], edi
  002d9	89 3f		 mov	 DWORD PTR [edi], edi
  002db	5f		 pop	 edi

; 469  : 
; 470  :    return TRUE;

  002dc	b0 01		 mov	 al, 1
  002de	5e		 pop	 esi

; 471  : }

  002df	5d		 pop	 ebp
  002e0	c2 04 00	 ret	 4
_SerialCleanLists@4 ENDP
_TEXT	ENDS
PUBLIC	_SerialReleaseResources@4
EXTRN	__imp__KeRemoveQueueDpc@4:NEAR
EXTRN	__imp__MmUnmapIoSpace@8:NEAR
EXTRN	__imp__KeSynchronizeExecution@12:NEAR
EXTRN	_SerialCancelTimer@8:NEAR
EXTRN	__imp__IoDisconnectInterrupt@4:NEAR
;	COMDAT _SerialReleaseResources@4
PAGESRP0	SEGMENT
$SG14992 DB	'EX: Pageable code called at IRQL %d', 0aH, 00H
	ORG $+3
$SG14995 DB	'f:\w2ddk\src\kernel\serial\initunlo.c', 00H
	ORG $+2
$SG14996 DB	'FALSE', 00H
	ORG $+2
$SG15003 DB	'SERIAL: Enter SerialReleaseResources', 0aH, 00H
	ORG $+2
$SG15020 DB	'SERIAL: Release - disconnecting interrupt %08X', 0aH, 00H
$SG15046 DB	'SERIAL: Release - freeing multi context', 0aH, 00H
	ORG $+3
$SG15074 DB	'SERIAL: Leave SerialReleaseResources', 0aH, 00H
; Function compile flags: /Ogs
_PDevExt$ = 8
_SerialReleaseResources@4 PROC NEAR			; COMDAT

; 492  : {

  00102	55		 push	 ebp
  00103	8b ec		 mov	 ebp, esp
  00105	56		 push	 esi

; 493  :    PAGED_CODE();

  00106	8b 35 00 00 00
	00		 mov	 esi, DWORD PTR __imp__KeGetCurrentIrql@0
  0010c	57		 push	 edi
  0010d	ff d6		 call	 esi
  0010f	3c 01		 cmp	 al, 1
  00111	76 29		 jbe	 SHORT $L14997
  00113	ff d6		 call	 esi
  00115	0f b6 c0	 movzx	 eax, al
  00118	50		 push	 eax
  00119	68 00 00 00 00	 push	 OFFSET FLAT:$SG14992
  0011e	e8 00 00 00 00	 call	 _DbgPrint
  00123	59		 pop	 ecx
  00124	59		 pop	 ecx
  00125	6a 00		 push	 0
  00127	68 ed 01 00 00	 push	 493			; 000001edH
  0012c	68 00 00 00 00	 push	 OFFSET FLAT:$SG14995
  00131	68 00 00 00 00	 push	 OFFSET FLAT:$SG14996
  00136	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L14997:

; 494  : 
; 495  :    SerialDump(SERTRACECALLS,("SERIAL: Enter SerialReleaseResources\n"));

  0013c	f6 05 00 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel, 64 ; 00000040H
  00143	74 0b		 je	 SHORT $L14998
  00145	68 00 00 00 00	 push	 OFFSET FLAT:$SG15003
  0014a	e8 00 00 00 00	 call	 _DbgPrint
  0014f	59		 pop	 ecx
$L14998:

; 496  : 
; 497  :    //
; 498  :    // Remove us from any lists we may be on
; 499  :    //
; 500  : 
; 501  :    if (PDevExt->Interrupt != NULL) {

  00150	8b 75 08	 mov	 esi, DWORD PTR _PDevExt$[ebp]
  00153	8b 86 a0 00 00
	00		 mov	 eax, DWORD PTR [esi+160]
  00159	85 c0		 test	 eax, eax
  0015b	74 0d		 je	 SHORT $L15011

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

  0015d	56		 push	 esi
  0015e	68 00 00 00 00	 push	 OFFSET FLAT:_SerialCleanLists@4
  00163	50		 push	 eax
  00164	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__KeSynchronizeExecution@12
$L15011:

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

  0016a	8b 86 a0 00 00
	00		 mov	 eax, DWORD PTR [esi+160]
  00170	53		 push	 ebx
  00171	8b 1d 00 00 00
	00		 mov	 ebx, DWORD PTR __imp__ExFreePool@4
  00177	85 c0		 test	 eax, eax
  00179	74 3b		 je	 SHORT $L15029

; 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));

  0017b	f6 05 01 00 00
	00 01		 test	 BYTE PTR _SerialDebugLevel+1, 1
  00182	74 0d		 je	 SHORT $L15015
  00184	50		 push	 eax
  00185	68 00 00 00 00	 push	 OFFSET FLAT:$SG15020
  0018a	e8 00 00 00 00	 call	 _DbgPrint
  0018f	59		 pop	 ecx
  00190	59		 pop	 ecx
$L15015:

; 517  : 
; 518  :       IoDisconnectInterrupt(PDevExt->Interrupt);

  00191	ff b6 a0 00 00
	00		 push	 DWORD PTR [esi+160]
  00197	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoDisconnectInterrupt@4

; 519  :       PDevExt->Interrupt = NULL;

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

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

  001a4	8d be c4 04 00
	00		 lea	 edi, DWORD PTR [esi+1220]
  001aa	8b 07		 mov	 eax, DWORD PTR [edi]
  001ac	85 c0		 test	 eax, eax
  001ae	74 06		 je	 SHORT $L15029

; 522  :          ExFreePool(PDevExt->CIsrSw);

  001b0	50		 push	 eax
  001b1	ff d3		 call	 ebx

; 523  :          PDevExt->CIsrSw = NULL;

  001b3	83 27 00	 and	 DWORD PTR [edi], 0
$L15029:

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

  001b6	80 be a3 01 00
	00 00		 cmp	 BYTE PTR [esi+419], 0
  001bd	74 3a		 je	 SHORT $L15039

; 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++) {

  001bf	8b 86 94 00 00
	00		 mov	 eax, DWORD PTR [esi+148]
  001c5	33 c9		 xor	 ecx, ecx
  001c7	83 c0 04	 add	 eax, 4
$L15033:

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

  001ca	83 38 00	 cmp	 DWORD PTR [eax], 0
  001cd	75 09		 jne	 SHORT $L16538
  001cf	41		 inc	 ecx
  001d0	83 c0 04	 add	 eax, 4
  001d3	83 f9 10	 cmp	 ecx, 16			; 00000010H
  001d6	72 f2		 jb	 SHORT $L15033
$L16538:

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

  001d8	83 f9 10	 cmp	 ecx, 16			; 00000010H
  001db	75 1c		 jne	 SHORT $L15039

; 542  :           SerialDump(SERPNPPOWER,("SERIAL: Release - freeing multi context\n"));

  001dd	f6 05 01 00 00
	00 01		 test	 BYTE PTR _SerialDebugLevel+1, 1
  001e4	74 0b		 je	 SHORT $L15041
  001e6	68 00 00 00 00	 push	 OFFSET FLAT:$SG15046
  001eb	e8 00 00 00 00	 call	 _DbgPrint
  001f0	59		 pop	 ecx
$L15041:

; 543  :           ExFreePool(PDevExt->OurIsrContext);

  001f1	ff b6 94 00 00
	00		 push	 DWORD PTR [esi+148]
  001f7	ff d3		 call	 ebx
$L15039:

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

  001f9	8d 86 b0 03 00
	00		 lea	 eax, DWORD PTR [esi+944]
  001ff	56		 push	 esi
  00200	50		 push	 eax
  00201	e8 00 00 00 00	 call	 _SerialCancelTimer@8

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

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

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

  00213	8d 86 00 04 00
	00		 lea	 eax, DWORD PTR [esi+1024]
  00219	56		 push	 esi
  0021a	50		 push	 eax
  0021b	e8 00 00 00 00	 call	 _SerialCancelTimer@8

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

  00220	8d 86 28 04 00
	00		 lea	 eax, DWORD PTR [esi+1064]
  00226	56		 push	 esi
  00227	50		 push	 eax
  00228	e8 00 00 00 00	 call	 _SerialCancelTimer@8

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

  0022d	8d 86 50 04 00
	00		 lea	 eax, DWORD PTR [esi+1104]
  00233	56		 push	 esi
  00234	50		 push	 eax
  00235	e8 00 00 00 00	 call	 _SerialCancelTimer@8

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

  0023a	8d 86 78 04 00
	00		 lea	 eax, DWORD PTR [esi+1144]
  00240	56		 push	 esi
  00241	50		 push	 eax

⌨️ 快捷键说明

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