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

📄 modmflow.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 5 页
字号:
  003e1	e9 eb 00 00 00	 jmp	 $L15098
$L15013:

; 483  :                    SERIAL_RTS_CONTROL) {

  003e6	83 f8 40	 cmp	 eax, 64			; 00000040H
  003e9	75 2a		 jne	 SHORT $L15052

; 484  : 
; 485  :             //
; 486  :             // Note that if we aren't currently doing rts flow control then
; 487  :             // we MIGHT have been.  So even if we aren't currently doing
; 488  :             // RTS flow control, we should still check if RX is holding
; 489  :             // because of RTS.  If it is, then we should clear the holding
; 490  :             // of this bit.
; 491  :             //
; 492  : 
; 493  :             if (Extension->RXHolding & SERIAL_RX_RTS) {

  003eb	8d 9e 20 01 00
	00		 lea	 ebx, DWORD PTR [esi+288]
  003f1	f6 03 04	 test	 BYTE PTR [ebx], 4
  003f4	74 bf		 je	 SHORT $L15016

; 494  : 
; 495  :                 SerialDump(
; 496  :                     SERFLOW,
; 497  :                     ("SERIAL: Clearing rts block of reception for %x\n",
; 498  :                     Extension->Controller)
; 499  :                     );

  003f6	85 3d 00 00 00
	00		 test	 DWORD PTR _SerialDebugLevel, edi
  003fc	74 12		 je	 SHORT $L15056
  003fe	ff b6 98 00 00
	00		 push	 DWORD PTR [esi+152]
  00404	68 00 00 00 00	 push	 OFFSET FLAT:$SG15061
  00409	e8 00 00 00 00	 call	 _DbgPrint
  0040e	59		 pop	 ecx
  0040f	59		 pop	 ecx
$L15056:

; 500  :                 Extension->RXHolding &= ~SERIAL_RX_RTS;

  00410	83 23 fb	 and	 DWORD PTR [ebx], -5	; fffffffbH

; 501  : 
; 502  :             }
; 503  : 
; 504  :             SerialSetRTS(Extension);
; 505  : 
; 506  :         } else if ((New.FlowReplace & SERIAL_RTS_MASK) ==

  00413	eb a0		 jmp	 SHORT $L15016
$L15052:

; 507  :                    SERIAL_TRANSMIT_TOGGLE) {

  00415	3b c3		 cmp	 eax, ebx
  00417	0f 85 8c 00 00
	00		 jne	 $L15072

; 508  : 
; 509  :             //
; 510  :             // We first need to check whether reception is being held
; 511  :             // up because of previous RTS flow control.  If it is then
; 512  :             // we should clear that reason in the RXHolding mask.
; 513  :             //
; 514  : 
; 515  :             if (Extension->RXHolding & SERIAL_RX_RTS) {

  0041d	f6 86 20 01 00
	00 04		 test	 BYTE PTR [esi+288], 4
  00424	74 21		 je	 SHORT $L15074

; 516  : 
; 517  :                 SerialDump(
; 518  :                     SERFLOW,
; 519  :                     ("SERIAL: TOGGLE Clearing rts block of reception for %x\n",
; 520  :                     Extension->Controller)
; 521  :                     );

  00426	85 3d 00 00 00
	00		 test	 DWORD PTR _SerialDebugLevel, edi
  0042c	74 12		 je	 SHORT $L15076
  0042e	ff b6 98 00 00
	00		 push	 DWORD PTR [esi+152]
  00434	68 00 00 00 00	 push	 OFFSET FLAT:$SG15081
  00439	e8 00 00 00 00	 call	 _DbgPrint
  0043e	59		 pop	 ecx
  0043f	59		 pop	 ecx
$L15076:

; 522  :                 Extension->RXHolding &= ~SERIAL_RX_RTS;

  00440	83 a6 20 01 00
	00 fb		 and	 DWORD PTR [esi+288], -5	; fffffffbH
$L15074:

; 523  : 
; 524  :             }
; 525  : 
; 526  :             //
; 527  :             // We have to place the rts value into the Extension
; 528  :             // now so that the code that tests whether the
; 529  :             // rts line should be lowered will find that we
; 530  :             // are "still" doing transmit toggling.  The code
; 531  :             // for lowering can be invoked later by a timer so
; 532  :             // it has to test whether it still needs to do its
; 533  :             // work.
; 534  :             //
; 535  : 
; 536  :             Extension->HandFlow.FlowReplace &= ~SERIAL_RTS_MASK;
; 537  :             Extension->HandFlow.FlowReplace |= SERIAL_TRANSMIT_TOGGLE;

  00447	09 9e 78 01 00
	00		 or	 DWORD PTR [esi+376], ebx

; 538  : 
; 539  :             //
; 540  :             // The order of the tests is very important below.
; 541  :             //
; 542  :             // If there is a break then we should turn on the RTS.
; 543  :             //
; 544  :             // If there isn't a break but there are characters in
; 545  :             // the hardware, then turn on the RTS.
; 546  :             //
; 547  :             // If there are writes pending that aren't being held
; 548  :             // up, then turn on the RTS.
; 549  :             //
; 550  : 
; 551  :             if ((Extension->TXHolding & SERIAL_TX_BREAK) ||
; 552  :                 ((SerialProcessLSR(Extension) & (SERIAL_LSR_THRE |
; 553  :                                                  SERIAL_LSR_TEMT)) !=
; 554  :                                                 (SERIAL_LSR_THRE |
; 555  :                                                  SERIAL_LSR_TEMT)) ||
; 556  :                 (Extension->CurrentWriteIrp || Extension->TransmitImmediate ||
; 557  :                  (!IsListEmpty(&Extension->WriteQueue)) &&
; 558  :                  (!Extension->TXHolding))) {

  0044d	f6 86 1c 01 00
	00 10		 test	 BYTE PTR [esi+284], 16	; 00000010H
  00454	0f 85 5b ff ff
	ff		 jne	 $L15016
  0045a	56		 push	 esi
  0045b	e8 00 00 00 00	 call	 _SerialProcessLSR@4
  00460	24 60		 and	 al, 96			; 00000060H
  00462	3c 60		 cmp	 al, 96			; 00000060H
  00464	0f 85 4b ff ff
	ff		 jne	 $L15016
  0046a	83 be c8 00 00
	00 00		 cmp	 DWORD PTR [esi+200], 0
  00471	0f 85 3e ff ff
	ff		 jne	 $L15016
  00477	80 be a1 01 00
	00 00		 cmp	 BYTE PTR [esi+417], 0
  0047e	0f 85 31 ff ff
	ff		 jne	 $L15016
  00484	8d 86 ac 00 00
	00		 lea	 eax, DWORD PTR [esi+172]
  0048a	39 00		 cmp	 DWORD PTR [eax], eax
  0048c	74 0d		 je	 SHORT $L15092
  0048e	83 be 1c 01 00
	00 00		 cmp	 DWORD PTR [esi+284], 0
  00495	0f 84 1a ff ff
	ff		 je	 $L15016
$L15092:

; 559  : 
; 560  :                 SerialSetRTS(Extension);
; 561  : 
; 562  :             } else {
; 563  : 
; 564  :                 //
; 565  :                 // This routine will check to see if it is time
; 566  :                 // to lower the RTS because of transmit toggle
; 567  :                 // being on.  If it is ok to lower it, it will,
; 568  :                 // if it isn't ok, it will schedule things so
; 569  :                 // that it will get lowered later.
; 570  :                 //
; 571  : 
; 572  :                 Extension->CountOfTryingToLowerRTS++;

  0049b	ff 86 3c 01 00
	00		 inc	 DWORD PTR [esi+316]

; 573  :                 SerialPerhapsLowerRTS(Extension);

  004a1	56		 push	 esi
  004a2	e8 00 00 00 00	 call	 _SerialPerhapsLowerRTS@4
  004a7	eb 2e		 jmp	 SHORT $L15096
$L15072:

; 574  : 
; 575  :             }
; 576  : 
; 577  :         } else {
; 578  : 
; 579  :             //
; 580  :             // The end result here will be that RTS is cleared.
; 581  :             //
; 582  :             // We first need to check whether reception is being held
; 583  :             // up because of previous RTS flow control.  If it is then
; 584  :             // we should clear that reason in the RXHolding mask.
; 585  :             //
; 586  : 
; 587  :             if (Extension->RXHolding & SERIAL_RX_RTS) {

  004a9	8d 9e 20 01 00
	00		 lea	 ebx, DWORD PTR [esi+288]
  004af	f6 03 04	 test	 BYTE PTR [ebx], 4
  004b2	74 1d		 je	 SHORT $L15098

; 588  : 
; 589  :                 SerialDump(
; 590  :                     SERFLOW,
; 591  :                     ("SERIAL: Clearing rts block of reception for %x\n",
; 592  :                     Extension->Controller)
; 593  :                     );

  004b4	85 3d 00 00 00
	00		 test	 DWORD PTR _SerialDebugLevel, edi
  004ba	74 12		 je	 SHORT $L15100
  004bc	ff b6 98 00 00
	00		 push	 DWORD PTR [esi+152]
  004c2	68 00 00 00 00	 push	 OFFSET FLAT:$SG15105
  004c7	e8 00 00 00 00	 call	 _DbgPrint
  004cc	59		 pop	 ecx
  004cd	59		 pop	 ecx
$L15100:

; 594  :                 Extension->RXHolding &= ~SERIAL_RX_RTS;

  004ce	83 23 fb	 and	 DWORD PTR [ebx], -5	; fffffffbH
$L15098:

; 595  : 
; 596  :             }
; 597  : 
; 598  :             SerialClrRTS(Extension);

  004d1	56		 push	 esi
  004d2	e8 00 00 00 00	 call	 _SerialClrRTS@4
$L15096:

; 599  : 
; 600  :         }
; 601  : 
; 602  :     }
; 603  : 
; 604  :     //
; 605  :     // We now take care of automatic receive flow control.
; 606  :     // We only do work if things have changed.
; 607  :     //
; 608  : 
; 609  :     if ((!Extension->DeviceIsOpened) ||
; 610  :         ((Extension->HandFlow.FlowReplace & SERIAL_AUTO_RECEIVE) !=
; 611  :          (New.FlowReplace & SERIAL_AUTO_RECEIVE))) {

  004d7	80 be 9d 01 00
	00 00		 cmp	 BYTE PTR [esi+413], 0
  004de	74 0d		 je	 SHORT $L15116
  004e0	8b 86 78 01 00
	00		 mov	 eax, DWORD PTR [esi+376]
  004e6	33 45 f4	 xor	 eax, DWORD PTR _New$[ebp+4]
  004e9	a8 02		 test	 al, 2
  004eb	74 3a		 je	 SHORT $L15123
$L15116:

; 612  : 
; 613  :         if (New.FlowReplace & SERIAL_AUTO_RECEIVE) {

  004ed	f6 45 f4 02	 test	 BYTE PTR _New$[ebp+4], 2
  004f1	74 1c		 je	 SHORT $L15118

; 614  : 
; 615  :             //
; 616  :             // We wouldn't be here if it had been on before.
; 617  :             //
; 618  :             // We should check to see whether we exceed the turn
; 619  :             // off limits.
; 620  :             //
; 621  :             // Note that since we are following the OS/2 flow
; 622  :             // control rules we will never send an xon if
; 623  :             // when enabling xon/xoff flow control we discover that
; 624  :             // we could receive characters but we are held up do
; 625  :             // to a previous Xoff.
; 626  :             //
; 627  : 
; 628  :             if ((Extension->BufferSize - New.XoffLimit) <=
; 629  :                 Extension->CharsInInterruptBuffer) {

  004f3	8b 86 04 01 00
	00		 mov	 eax, DWORD PTR [esi+260]
  004f9	2b 45 fc	 sub	 eax, DWORD PTR _New$[ebp+12]
  004fc	3b 86 f0 00 00
	00		 cmp	 eax, DWORD PTR [esi+240]
  00502	77 23		 ja	 SHORT $L15123

; 630  : 
; 631  :                 //
; 632  :                 // Cause the Xoff to be sent.
; 633  :                 //
; 634  : 
; 635  :                 Extension->RXHolding |= SERIAL_RX_XOFF;

  00504	83 8e 20 01 00
	00 02		 or	 DWORD PTR [esi+288], 2

; 636  : 
; 637  :                 SerialProdXonXoff(
; 638  :                     Extension,
; 639  :                     FALSE
; 640  :                     );

  0050b	6a 00		 push	 0

; 641  : 
; 642  :             }
; 643  : 
; 644  :         } else {

  0050d	eb 12		 jmp	 SHORT $L15489
$L15118:

; 645  : 
; 646  :             //
; 647  :             // The app has disabled automatic receive flow control.
; 648  :             //
; 649  :             // If transmission was being held up because of
; 650  :             // an automatic receive Xoff, then we should
; 651  :             // cause an Xon to be sent.
; 652  :             //
; 653  : 
; 654  :             if (Extension->RXHolding & SERIAL_RX_XOFF) {

  0050f	8d 8e 20 01 00
	00		 lea	 ecx, DWORD PTR [esi+288]
  00515	8b 01		 mov	 eax, DWORD PTR [ecx]
  00517	a8 02		 test	 al, 2
  00519	74 0c		 je	 SHORT $L15123

; 655  : 
; 656  :                 Extension->RXHolding &= ~SERIAL_RX_XOFF;

  0051b	24 fd		 and	 al, -3			; fffffffdH

; 657  : 
; 658  :                 //
; 659  :                 // Cause the Xon to be sent.
; 660  :                 //
; 661  : 
; 662  :                 SerialProdXonXoff(
; 663  :                     Extension,
; 664  :                     TRUE
; 665  :                     );

  0051d	6a 01		 push	 1
  0051f	89 01		 mov	 DWORD PTR [ecx], eax
$L15489:
  00521	56		 push	 esi
  00522	e8 00 00 00 00	 call	 _SerialProdXonXoff@8
$L15123:

; 666  : 
; 667  :             }
; 668  : 
; 669  :         }
; 670  : 
; 671  :     }
; 672  : 
; 673  :     //
; 674  :     // We now take care of automatic transmit flow control.
; 675  :     // We only do work if things have changed.
; 676  :     //
; 677  : 
; 678  :     if ((!Extension->DeviceIsOpened) ||
; 679  :         ((Extension->HandFlow.FlowReplace & SERIAL_AUTO_TRANSMIT) !=
; 680  :          (New.FlowReplace & SERIAL_AUTO_TRANSMIT))) {

  00527	80 be 9d 01 00
	00 00		 cmp	 BYTE PTR [esi+413], 0
  0052e	74 0d		 je	 SHORT $L15128
  00530	8b 86 78 01 00
	00		 mov	 eax, DWORD PTR [esi+376]
  00536	33 45 f4	 xor	 eax, DWORD PTR _New$[ebp+4]
  00539	a8 01		 test	 al, 1
  0053b	74 1e		 je	 SHORT $L15133
$L15128:

; 681  : 
; 682  :         if (New.FlowReplace & SERIAL_AUTO_TRANSMIT) {

  0053d	f6 45 f4 01	 test	 BYTE PTR _New$[ebp+4], 1
  00541	75 18		 jne	 SHORT $L15133

; 683  : 
; 684  :             //
; 685  :             // We wouldn't be here if it had been on before.
; 686  :             //
; 687  :             // BUG BUG ??? There is some belief that if autotransmit
; 688  :             // was just enabled, I should go look in what we
; 689  :             // already received, and if we find the xoff character
; 690  :             // then we should stop transmitting.  I think this
; 691  :             // is an application bug.  For now we just care about
; 692  :             // what we see in the future.
; 693  :             //
; 694  : 
; 695  :             ;
; 696  : 
; 697  :         } else {
; 698  : 
; 699  :             //
; 700  :             // The app has disabled automatic transmit flow control.
; 701  :             //
; 702  :             // If transmission was being held up because of
; 703  :             // an automatic transmit Xoff, then we should
; 704  :             // cause an Xon to be sent.
; 705  :             //
; 706  : 
; 707  :             if (Extension->TXHolding & SERIAL_TX_XOFF) {

  00543	8d 8e 1c 01 00
	00		 lea	 ecx, DWORD PTR [esi+284]
  00549	8b 01		 mov	 eax, DWORD PTR [ecx]
  0054b	a8 08		 test	 al, 8
  0054d	74 0c		 je	 SHORT $L15133

; 708  : 
; 709  :                 Extension->TXHolding &= ~SERIAL_TX_XOFF;

  0054f	24 f7		 and	 al, -9			; fffffff7H

; 710  : 
; 711  :                 //
; 712  :                 // Cause the Xon to be sent.
; 713  :                 //
; 714  : 
; 715  :                 SerialProdXonXoff(
; 716  :                     Extension,
; 717  :                     TRUE
; 718  :                     );

  00551	6a 01		 push	 1
  00553	56		 push	 esi
  00554	89 01		 mov	 DWORD PTR [ecx], eax
  00556	e8 00 00 00 00	 call	 _SerialProdXonXoff@8
$L15133:

; 719  : 
; 720  :             }
; 721  : 
; 722  :         }
; 723  : 
; 724  :     }

⌨️ 快捷键说明

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