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

📄 waitmask.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 4 页
字号:
; 373  : 
; 374  : }

  00a2c	c9		 leave
  00a2d	c2 04 00	 ret	 4
_SerialStartMask@4 ENDP
PAGESER	ENDS
PUBLIC	_SerialGrabWaitFromIsr@4
;	COMDAT _SerialGrabWaitFromIsr@4
PAGESER	SEGMENT
$SG15078 DB	'SERIAL: Pageable code called at IRQL %d without lock ', 0aH
	DB	00H
	ORG $+1
$SG15081 DB	'f:\w2ddk\src\kernel\serial\waitmask.c', 00H
	ORG $+2
$SG15082 DB	'FALSE', 00H
	ORG $+2
$SG15089 DB	'SERIAL: In SerialGrabWaitFromIsr', 0aH, 00H
	ORG $+6
$SG15103 DB	'SERIAL: The isr still owns the irp %x, mask location is '
	DB	'%x', 0aH, '------- and system buffer is %x', 0aH, 00H
$SG15120 DB	'f:\w2ddk\src\kernel\serial\waitmask.c', 00H
	ORG $+2
$SG15121 DB	'*_arg4 & _refType', 00H
; Function compile flags: /Ogs
_Context$ = 8
_SerialGrabWaitFromIsr@4 PROC NEAR			; COMDAT

; 403  : {

  00126	55		 push	 ebp
  00127	8b ec		 mov	 ebp, esp
  00129	56		 push	 esi

; 404  : 
; 405  :     PSERIAL_DEVICE_EXTENSION Extension = Context;
; 406  :     SERIAL_LOCKED_PAGED_CODE();

  0012a	8b 35 00 00 00
	00		 mov	 esi, DWORD PTR __imp__KeGetCurrentIrql@0
  00130	57		 push	 edi
  00131	ff d6		 call	 esi
  00133	33 ff		 xor	 edi, edi
  00135	3c 01		 cmp	 al, 1
  00137	76 30		 jbe	 SHORT $L15083
  00139	39 3d 14 00 00
	00		 cmp	 DWORD PTR _SerialGlobals+20, edi
  0013f	75 28		 jne	 SHORT $L15083
  00141	ff d6		 call	 esi
  00143	0f b6 c0	 movzx	 eax, al
  00146	50		 push	 eax
  00147	68 00 00 00 00	 push	 OFFSET FLAT:$SG15078
  0014c	e8 00 00 00 00	 call	 _DbgPrint
  00151	59		 pop	 ecx
  00152	59		 pop	 ecx
  00153	57		 push	 edi
  00154	68 96 01 00 00	 push	 406			; 00000196H
  00159	68 00 00 00 00	 push	 OFFSET FLAT:$SG15081
  0015e	68 00 00 00 00	 push	 OFFSET FLAT:$SG15082
  00163	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L15083:

; 407  : 
; 408  :     SerialDump(
; 409  :         SERDIAG3,
; 410  :         ("SERIAL: In SerialGrabWaitFromIsr\n")
; 411  :         );

  00169	f6 05 00 00 00
	00 04		 test	 BYTE PTR _SerialDebugLevel, 4
  00170	74 0b		 je	 SHORT $L15084
  00172	68 00 00 00 00	 push	 OFFSET FLAT:$SG15089
  00177	e8 00 00 00 00	 call	 _DbgPrint
  0017c	59		 pop	 ecx
$L15084:

; 412  : 
; 413  :     if (Extension->IrpMaskLocation) {

  0017d	8b 75 08	 mov	 esi, DWORD PTR _Context$[ebp]
  00180	8b 8e 18 01 00
	00		 mov	 ecx, DWORD PTR [esi+280]
  00186	3b cf		 cmp	 ecx, edi
  00188	74 64		 je	 SHORT $L15114

; 414  : 
; 415  :         SerialDump(
; 416  :             SERDIAG4,
; 417  :             ("SERIAL: The isr still owns the irp %x, mask location is %x\n"
; 418  :              "------- and system buffer is %x\n",
; 419  :              Extension->CurrentWaitIrp,Extension->IrpMaskLocation,
; 420  :              Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer)
; 421  :             );

  0018a	f6 05 00 00 00
	00 08		 test	 BYTE PTR _SerialDebugLevel, 8
  00191	74 18		 je	 SHORT $L15098
  00193	8b 86 d4 00 00
	00		 mov	 eax, DWORD PTR [esi+212]
  00199	ff 70 0c	 push	 DWORD PTR [eax+12]
  0019c	51		 push	 ecx
  0019d	50		 push	 eax
  0019e	68 00 00 00 00	 push	 OFFSET FLAT:$SG15103
  001a3	e8 00 00 00 00	 call	 _DbgPrint
  001a8	83 c4 10	 add	 esp, 16			; 00000010H
$L15098:

; 422  : 
; 423  :         //
; 424  :         // The isr still "owns" the irp.
; 425  :         //
; 426  : 
; 427  :         *Extension->IrpMaskLocation = 0;

  001ab	8b 86 18 01 00
	00		 mov	 eax, DWORD PTR [esi+280]
  001b1	89 38		 mov	 DWORD PTR [eax], edi

; 428  :         Extension->IrpMaskLocation = NULL;
; 429  : 
; 430  :         Extension->CurrentWaitIrp->IoStatus.Information = sizeof(ULONG);

  001b3	8d 86 d4 00 00
	00		 lea	 eax, DWORD PTR [esi+212]
  001b9	89 be 18 01 00
	00		 mov	 DWORD PTR [esi+280], edi
  001bf	8b 08		 mov	 ecx, DWORD PTR [eax]
  001c1	c7 41 1c 04 00
	00 00		 mov	 DWORD PTR [ecx+28], 4

; 431  : 
; 432  :         //
; 433  :         // Since the isr no longer references the irp we need to
; 434  :         // decrement the reference count.
; 435  :         //
; 436  : 
; 437  :         SERIAL_CLEAR_REFERENCE(
; 438  :             Extension->CurrentWaitIrp,
; 439  :             SERIAL_REF_ISR
; 440  :             );

  001c8	8b 00		 mov	 eax, DWORD PTR [eax]
  001ca	8b 70 60	 mov	 esi, DWORD PTR [eax+96]
  001cd	83 c6 10	 add	 esi, 16			; 00000010H
  001d0	f6 06 01	 test	 BYTE PTR [esi], 1
  001d3	75 16		 jne	 SHORT $L15118
  001d5	57		 push	 edi
  001d6	68 b8 01 00 00	 push	 440			; 000001b8H
  001db	68 00 00 00 00	 push	 OFFSET FLAT:$SG15120
  001e0	68 00 00 00 00	 push	 OFFSET FLAT:$SG15121
  001e5	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L15118:
  001eb	83 26 fe	 and	 DWORD PTR [esi], -2	; fffffffeH
$L15114:
  001ee	5f		 pop	 edi

; 441  : 
; 442  :     }
; 443  : 
; 444  :     return FALSE;

  001ef	32 c0		 xor	 al, al
  001f1	5e		 pop	 esi

; 445  : }

  001f2	5d		 pop	 ebp
  001f3	c2 04 00	 ret	 4
_SerialGrabWaitFromIsr@4 ENDP
PAGESER	ENDS
EXTRN	_SerialInsertQueueDpc@16:NEAR
;	COMDAT _SerialGiveWaitToIsr@4
PAGESER	SEGMENT
$SG15127 DB	'SERIAL: Pageable code called at IRQL %d without lock ', 0aH
	DB	00H
	ORG $+1
$SG15130 DB	'f:\w2ddk\src\kernel\serial\waitmask.c', 00H
	ORG $+2
$SG15131 DB	'FALSE', 00H
	ORG $+2
$SG15138 DB	'SERIAL: In SerialGiveWaitToIsr', 0aH, 00H
$SG15147 DB	'f:\w2ddk\src\kernel\serial\waitmask.c', 00H
	ORG $+2
$SG15148 DB	'!Extension->IrpMaskLocation', 00H
$SG15157 DB	'f:\w2ddk\src\kernel\serial\waitmask.c', 00H
	ORG $+2
$SG15158 DB	'!(*_arg4 & _refType)', 00H
	ORG $+3
$SG15166 DB	'SERIAL: No events occured prior to the wait call', 0aH, 00H
	ORG $+2
$SG15179 DB	'SERIAL: The isr owns the irp %x, mask location is %x', 0aH
	DB	'------- and system buffer is %x', 0aH, 00H
	ORG $+2
$SG15193 DB	'SERIAL: %x occurred prior to the wait - starting the', 0aH
	DB	'------- completion code for %x', 0aH, 00H
; Function compile flags: /Ogs
_Context$ = 8
_SerialGiveWaitToIsr@4 PROC NEAR			; COMDAT

; 474  : {

  001ed	55		 push	 ebp
  001ee	8b ec		 mov	 ebp, esp
  001f0	53		 push	 ebx
  001f1	56		 push	 esi

; 475  : 
; 476  :     PSERIAL_DEVICE_EXTENSION Extension = Context;
; 477  :     SERIAL_LOCKED_PAGED_CODE();

  001f2	8b 35 00 00 00
	00		 mov	 esi, DWORD PTR __imp__KeGetCurrentIrql@0
  001f8	57		 push	 edi
  001f9	ff d6		 call	 esi
  001fb	8b 1d 00 00 00
	00		 mov	 ebx, DWORD PTR __imp__RtlAssert@16
  00201	3c 01		 cmp	 al, 1
  00203	76 2e		 jbe	 SHORT $L15132
  00205	83 3d 14 00 00
	00 00		 cmp	 DWORD PTR _SerialGlobals+20, 0
  0020c	75 25		 jne	 SHORT $L15132
  0020e	ff d6		 call	 esi
  00210	0f b6 c0	 movzx	 eax, al
  00213	50		 push	 eax
  00214	68 00 00 00 00	 push	 OFFSET FLAT:$SG15127
  00219	e8 00 00 00 00	 call	 _DbgPrint
  0021e	59		 pop	 ecx
  0021f	59		 pop	 ecx
  00220	6a 00		 push	 0
  00222	68 dd 01 00 00	 push	 477			; 000001ddH
  00227	68 00 00 00 00	 push	 OFFSET FLAT:$SG15130
  0022c	68 00 00 00 00	 push	 OFFSET FLAT:$SG15131
  00231	ff d3		 call	 ebx
$L15132:

; 478  : 
; 479  :     SerialDump(
; 480  :         SERDIAG3,
; 481  :         ("SERIAL: In SerialGiveWaitToIsr\n")
; 482  :         );

  00233	f6 05 00 00 00
	00 04		 test	 BYTE PTR _SerialDebugLevel, 4
  0023a	74 0b		 je	 SHORT $L15133
  0023c	68 00 00 00 00	 push	 OFFSET FLAT:$SG15138
  00241	e8 00 00 00 00	 call	 _DbgPrint
  00246	59		 pop	 ecx
$L15133:

; 483  :     //
; 484  :     // There certainly shouldn't be a current mask location at
; 485  :     // this point since we have a new current wait irp.
; 486  :     //
; 487  : 
; 488  :     ASSERT(!Extension->IrpMaskLocation);

  00247	8b 75 08	 mov	 esi, DWORD PTR _Context$[ebp]
  0024a	83 be 18 01 00
	00 00		 cmp	 DWORD PTR [esi+280], 0
  00251	74 13		 je	 SHORT $L15149
  00253	6a 00		 push	 0
  00255	68 e8 01 00 00	 push	 488			; 000001e8H
  0025a	68 00 00 00 00	 push	 OFFSET FLAT:$SG15147
  0025f	68 00 00 00 00	 push	 OFFSET FLAT:$SG15148
  00264	ff d3		 call	 ebx
$L15149:

; 489  : 
; 490  :     //
; 491  :     // The isr may or may not actually reference this irp.  It
; 492  :     // won't if the wait can be satisfied immediately.  However,
; 493  :     // since it will then go through the normal completion sequence,
; 494  :     // we need to have an incremented reference count anyway.
; 495  :     //
; 496  : 
; 497  :     SERIAL_SET_REFERENCE(
; 498  :         Extension->CurrentWaitIrp,
; 499  :         SERIAL_REF_ISR
; 500  :         );

  00266	8b 86 d4 00 00
	00		 mov	 eax, DWORD PTR [esi+212]
  0026c	8b 78 60	 mov	 edi, DWORD PTR [eax+96]
  0026f	83 c7 10	 add	 edi, 16			; 00000010H
  00272	f6 07 01	 test	 BYTE PTR [edi], 1
  00275	74 13		 je	 SHORT $L15155
  00277	6a 00		 push	 0
  00279	68 f4 01 00 00	 push	 500			; 000001f4H
  0027e	68 00 00 00 00	 push	 OFFSET FLAT:$SG15157
  00283	68 00 00 00 00	 push	 OFFSET FLAT:$SG15158
  00288	ff d3		 call	 ebx
$L15155:
  0028a	83 0f 01	 or	 DWORD PTR [edi], 1

; 501  : 
; 502  :     if (!Extension->HistoryMask) {

  0028d	8b 86 14 01 00
	00		 mov	 eax, DWORD PTR [esi+276]
  00293	33 ff		 xor	 edi, edi
  00295	3b c7		 cmp	 eax, edi
  00297	75 47		 jne	 SHORT $L15187

; 503  : 
; 504  :         SerialDump(
; 505  :             SERDIAG4,
; 506  :             ("SERIAL: No events occured prior to the wait call\n")
; 507  :             );

  00299	f6 05 00 00 00
	00 08		 test	 BYTE PTR _SerialDebugLevel, 8
  002a0	74 0b		 je	 SHORT $L15161
  002a2	68 00 00 00 00	 push	 OFFSET FLAT:$SG15166
  002a7	e8 00 00 00 00	 call	 _DbgPrint
  002ac	59		 pop	 ecx
$L15161:

; 508  : 
; 509  :         //
; 510  :         // Although this wait might not be for empty transmit
; 511  :         // queue, it doesn't hurt anything to set it to false.
; 512  :         //
; 513  : 
; 514  :         Extension->EmptiedTransmit = FALSE;
; 515  : 
; 516  :         //
; 517  :         // Record where the "completion mask" should be set.
; 518  :         //
; 519  : 
; 520  :         Extension->IrpMaskLocation =
; 521  :             Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer;

  002ad	8b 86 d4 00 00
	00		 mov	 eax, DWORD PTR [esi+212]
  002b3	80 a6 a2 01 00
	00 00		 and	 BYTE PTR [esi+418], 0
  002ba	8b 48 0c	 mov	 ecx, DWORD PTR [eax+12]
  002bd	89 8e 18 01 00
	00		 mov	 DWORD PTR [esi+280], ecx

; 522  :         SerialDump(
; 523  :             SERDIAG4,
; 524  :             ("SERIAL: The isr owns the irp %x, mask location is %x\n"
; 525  :              "------- and system buffer is %x\n",
; 526  :              Extension->CurrentWaitIrp,Extension->IrpMaskLocation,
; 527  :              Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer)
; 528  :             );

  002c3	f6 05 00 00 00
	00 08		 test	 BYTE PTR _SerialDebugLevel, 8
  002ca	74 6d		 je	 SHORT $L15186
  002cc	ff 70 0c	 push	 DWORD PTR [eax+12]
  002cf	51		 push	 ecx
  002d0	50		 push	 eax
  002d1	68 00 00 00 00	 push	 OFFSET FLAT:$SG15179
  002d6	e8 00 00 00 00	 call	 _DbgPrint
  002db	83 c4 10	 add	 esp, 16			; 00000010H

; 529  : 
; 530  :     } else {

  002de	eb 59		 jmp	 SHORT $L15186
$L15187:

; 531  : 
; 532  :         SerialDump(
; 533  :             SERDIAG4,
; 534  :             ("SERIAL: %x occurred prior to the wait - starting the\n"
; 535  :              "------- completion code for %x\n",
; 536  :              Extension->HistoryMask,Extension->CurrentWaitIrp)
; 537  :             );

  002e0	f6 05 00 00 00
	00 08		 test	 BYTE PTR _SerialDebugLevel, 8
  002e7	74 14		 je	 SHORT $L15188
  002e9	ff b6 d4 00 00
	00		 push	 DWORD PTR [esi+212]
  002ef	50		 push	 eax
  002f0	68 00 00 00 00	 push	 OFFSET FLAT:$SG15193
  002f5	e8 00 00 00 00	 call	 _DbgPrint
  002fa	83 c4 0c	 add	 esp, 12			; 0000000cH
$L15188:

; 538  :         *((ULONG *)Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer) =
; 539  :             Extension->HistoryMask;

  002fd	8b 86 d4 00 00
	00		 mov	 eax, DWORD PTR [esi+212]
  00303	8b 8e 14 01 00
	00		 mov	 ecx, DWORD PTR [esi+276]

; 540  :         Extension->HistoryMask = 0;
; 541  :         Extension->CurrentWaitIrp->IoStatus.Information = sizeof(ULONG);
; 542  :         Extension->CurrentWaitIrp->IoStatus.Status = STATUS_SUCCESS;
; 543  : 
; 544  :         SerialInsertQueueDpc(
; 545  :             &Extension->CommWaitDpc,
; 546  :             NULL,
; 547  :             NULL,
; 548  :             Extension
; 549  :             );

  00309	56		 push	 esi
  0030a	57		 push	 edi
  0030b	8b 40 0c	 mov	 eax, DWORD PTR [eax+12]
  0030e	81 c6 ac 02 00
	00		 add	 esi, 684		; 000002acH
  00314	57		 push	 edi
  00315	56		 push	 esi
  00316	89 08		 mov	 DWORD PTR [eax], ecx
  00318	8b 86 28 fe ff
	ff		 mov	 eax, DWORD PTR [esi-472]
  0031e	89 be 68 fe ff
	ff		 mov	 DWORD PTR [esi-408], edi
  00324	c7 40 1c 04 00
	00 00		 mov	 DWORD PTR [eax+28], 4
  0032b	8b 86 28 fe ff
	ff		 mov	 eax, DWORD PTR [esi-472]
  00331	89 78 18	 mov	 DWORD PTR [eax+24], edi
  00334	e8 00 00 00 00	 call	 _SerialInsertQueueDpc@16
$L15186:
  00339	5f		 pop	 edi
  0033a	5e		 pop	 esi

; 550  : 
; 551  :     }
; 552  : 
; 553  :     return FALSE;

  0033b	32 c0		 xor	 al, al
  0033d	5b		 pop	 ebx

; 554  : }

  0033e	5d		 pop	 ebp
  0033f	c2 04 00	 ret	 4
_SerialGiveWaitToIsr@4 ENDP
PAGESER	ENDS
;	COMDAT _SerialFinishOldWait@4
PAGESER	SEGMENT
$SG15210 DB	'SERIAL: Pageable code called at IRQL %d without lock ', 0aH
	DB	00H
	ORG $+1

⌨️ 快捷键说明

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