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

📄 waitmask.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 3 页
字号:
; 519  : 
; 520  :         Extension->IrpMaskLocation =
; 521  :             Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer;

  0001f	8b 88 d4 00 00
	00		 mov	 ecx, DWORD PTR [eax+212]
  00025	88 90 a2 01 00
	00		 mov	 BYTE PTR [eax+418], dl
  0002b	8b 49 0c	 mov	 ecx, DWORD PTR [ecx+12]
  0002e	89 88 18 01 00
	00		 mov	 DWORD PTR [eax+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  :             );
; 529  : 
; 530  :     } else {

  00034	eb 37		 jmp	 SHORT $L14898
$L14899:
  00036	56		 push	 esi

; 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  :             );
; 538  :         *((ULONG *)Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer) =
; 539  :             Extension->HistoryMask;

  00037	8b b0 d4 00 00
	00		 mov	 esi, DWORD PTR [eax+212]

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

  0003d	50		 push	 eax
  0003e	52		 push	 edx
  0003f	8b 76 0c	 mov	 esi, DWORD PTR [esi+12]
  00042	05 ac 02 00 00	 add	 eax, 684		; 000002acH
  00047	52		 push	 edx
  00048	50		 push	 eax
  00049	89 0e		 mov	 DWORD PTR [esi], ecx
  0004b	8b 88 28 fe ff
	ff		 mov	 ecx, DWORD PTR [eax-472]
  00051	89 90 68 fe ff
	ff		 mov	 DWORD PTR [eax-408], edx
  00057	c7 41 1c 04 00
	00 00		 mov	 DWORD PTR [ecx+28], 4
  0005e	8b 88 28 fe ff
	ff		 mov	 ecx, DWORD PTR [eax-472]
  00064	89 51 18	 mov	 DWORD PTR [ecx+24], edx
  00067	e8 00 00 00 00	 call	 _SerialInsertQueueDpc@16
  0006c	5e		 pop	 esi
$L14898:

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

  0006d	32 c0		 xor	 al, al

; 554  : }

  0006f	c2 04 00	 ret	 4
_SerialGiveWaitToIsr@4 ENDP
; Function compile flags: /Ogsy
PAGESER	ENDS
;	COMDAT _SerialFinishOldWait@4
PAGESER	SEGMENT
_Context$ = 8
_SerialFinishOldWait@4 PROC NEAR			; COMDAT

; 583  : {

  00000	56		 push	 esi

; 584  : 
; 585  :     PSERIAL_DEVICE_EXTENSION Extension = Context;
; 586  :     SERIAL_LOCKED_PAGED_CODE();
; 587  : 
; 588  :     SerialDump(
; 589  :         SERDIAG3,
; 590  :         ("SERIAL: In SerialFinishOldWait\n")
; 591  :         );
; 592  :     if (Extension->IrpMaskLocation) {

  00001	8b 74 24 08	 mov	 esi, DWORD PTR _Context$[esp]
  00005	33 d2		 xor	 edx, edx
  00007	8d 86 18 01 00
	00		 lea	 eax, DWORD PTR [esi+280]
  0000d	8b 08		 mov	 ecx, DWORD PTR [eax]
  0000f	3b ca		 cmp	 ecx, edx
  00011	74 20		 je	 SHORT $L14914

; 593  : 
; 594  :         SerialDump(
; 595  :             SERDIAG4,
; 596  :             ("SERIAL: The isr still owns the irp %x, mask location is %x\n"
; 597  :              "------- and system buffer is %x\n",
; 598  :              Extension->CurrentWaitIrp,Extension->IrpMaskLocation,
; 599  :              Extension->CurrentWaitIrp->AssociatedIrp.SystemBuffer)
; 600  :             );
; 601  :         //
; 602  :         // The isr still "owns" the irp.
; 603  :         //
; 604  : 
; 605  :         *Extension->IrpMaskLocation = 0;

  00013	89 11		 mov	 DWORD PTR [ecx], edx

; 606  :         Extension->IrpMaskLocation = NULL;

  00015	89 10		 mov	 DWORD PTR [eax], edx

; 607  : 
; 608  :         Extension->CurrentWaitIrp->IoStatus.Information = sizeof(ULONG);

  00017	8b 86 d4 00 00
	00		 mov	 eax, DWORD PTR [esi+212]

; 609  : 
; 610  :         //
; 611  :         // We don't decrement the reference since the completion routine
; 612  :         // will do that.
; 613  :         //
; 614  : 
; 615  :         SerialInsertQueueDpc(
; 616  :             &Extension->CommWaitDpc,
; 617  :             NULL,
; 618  :             NULL,
; 619  :             Extension
; 620  :             );

  0001d	56		 push	 esi
  0001e	52		 push	 edx
  0001f	52		 push	 edx
  00020	c7 40 1c 04 00
	00 00		 mov	 DWORD PTR [eax+28], 4
  00027	8d 86 ac 02 00
	00		 lea	 eax, DWORD PTR [esi+684]
  0002d	50		 push	 eax
  0002e	e8 00 00 00 00	 call	 _SerialInsertQueueDpc@16
$L14914:

; 621  : 
; 622  :     }
; 623  : 
; 624  :     //
; 625  :     // Don't wipe out any historical data we are still interested in.
; 626  :     //
; 627  : 
; 628  :     Extension->HistoryMask &= *((ULONG *)Extension->CurrentMaskIrp->
; 629  :                                             AssociatedIrp.SystemBuffer);

  00033	8b 86 cc 00 00
	00		 mov	 eax, DWORD PTR [esi+204]
  00039	8b 48 0c	 mov	 ecx, DWORD PTR [eax+12]
  0003c	8b 09		 mov	 ecx, DWORD PTR [ecx]
  0003e	21 8e 14 01 00
	00		 and	 DWORD PTR [esi+276], ecx

; 630  : 
; 631  :     Extension->IsrWaitMask = *((ULONG *)Extension->CurrentMaskIrp->
; 632  :                                             AssociatedIrp.SystemBuffer);

  00044	8b 40 0c	 mov	 eax, DWORD PTR [eax+12]
  00047	8b 00		 mov	 eax, DWORD PTR [eax]
  00049	89 86 10 01 00
	00		 mov	 DWORD PTR [esi+272], eax

; 633  :     SerialDump(
; 634  :         SERDIAG4,
; 635  :         ("SERIAL: Set mask location of %x, in irp %x, with system buffer of %x\n",
; 636  :          Extension->IrpMaskLocation,
; 637  :          Extension->CurrentMaskIrp,Extension->CurrentMaskIrp->AssociatedIrp.SystemBuffer)
; 638  :         );
; 639  :     return FALSE;

  0004f	32 c0		 xor	 al, al
  00051	5e		 pop	 esi

; 640  : }

  00052	c2 04 00	 ret	 4
_SerialFinishOldWait@4 ENDP
PAGESER	ENDS
EXTRN	_SerialTryToCompleteCurrent@44:NEAR
; Function compile flags: /Ogsy
;	COMDAT _SerialCancelWait@8
PAGESER	SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_SerialCancelWait@8 PROC NEAR				; COMDAT

; 668  : 
; 669  :     PSERIAL_DEVICE_EXTENSION Extension = DeviceObject->DeviceExtension;

  00000	8b 44 24 04	 mov	 eax, DWORD PTR _DeviceObject$[esp-4]

; 670  :     SERIAL_LOCKED_PAGED_CODE();
; 671  : 
; 672  :     SerialDump(
; 673  :         SERDIAG3,
; 674  :         ("SERIAL: In SerialCancelWait\n")
; 675  :         );
; 676  : 
; 677  :     SerialDump(
; 678  :         SERDIAG4,
; 679  :         ("SERIAL: Canceling wait for irp %x\n",Extension->CurrentWaitIrp)
; 680  :         );
; 681  :     SerialTryToCompleteCurrent(
; 682  :         Extension,
; 683  :         SerialGrabWaitFromIsr,
; 684  :         Irp->CancelIrql,
; 685  :         STATUS_CANCELLED,
; 686  :         &Extension->CurrentWaitIrp,
; 687  :         NULL,
; 688  :         NULL,
; 689  :         NULL,
; 690  :         NULL,
; 691  :         NULL,
; 692  :         SERIAL_REF_CANCEL
; 693  :         );

  00004	33 c9		 xor	 ecx, ecx
  00006	6a 02		 push	 2
  00008	51		 push	 ecx
  00009	8b 40 28	 mov	 eax, DWORD PTR [eax+40]
  0000c	51		 push	 ecx
  0000d	51		 push	 ecx
  0000e	51		 push	 ecx
  0000f	51		 push	 ecx
  00010	8d 88 d4 00 00
	00		 lea	 ecx, DWORD PTR [eax+212]
  00016	51		 push	 ecx
  00017	8b 4c 24 24	 mov	 ecx, DWORD PTR _Irp$[esp+24]
  0001b	68 20 01 00 c0	 push	 -1073741536		; c0000120H
  00020	8a 49 25	 mov	 cl, BYTE PTR [ecx+37]
  00023	51		 push	 ecx
  00024	68 00 00 00 00	 push	 OFFSET FLAT:_SerialGrabWaitFromIsr@4
  00029	50		 push	 eax
  0002a	e8 00 00 00 00	 call	 _SerialTryToCompleteCurrent@44

; 694  : 
; 695  : }

  0002f	c2 08 00	 ret	 8
_SerialCancelWait@8 ENDP
PAGESER	ENDS
PUBLIC	_SerialCompleteWait@16
EXTRN	_SerialDpcEpilogue@8:NEAR
; Function compile flags: /Ogsy
;	COMDAT _SerialCompleteWait@16
_TEXT	SEGMENT
_Dpc$ = 8
_DeferredContext$ = 12
_OldIrql$ = -4
_SerialCompleteWait@16 PROC NEAR			; COMDAT

; 705  : {

  00000	55		 push	 ebp
  00001	8b ec		 mov	 ebp, esp
  00003	51		 push	 ecx

; 706  : 
; 707  :     PSERIAL_DEVICE_EXTENSION Extension = DeferredContext;
; 708  :     KIRQL OldIrql;
; 709  : 
; 710  : 
; 711  :     SerialDump(SERTRACECALLS, ("SERIAL: SerialCompleteWait\n"));
; 712  : 
; 713  :     SerialDump(
; 714  :         SERDIAG3,
; 715  :         ("SERIAL: In SerialCompleteWait\n")
; 716  :         );
; 717  :     UNREFERENCED_PARAMETER(SystemContext1);
; 718  :     UNREFERENCED_PARAMETER(SystemContext2);
; 719  : 
; 720  :     IoAcquireCancelSpinLock(&OldIrql);

  00004	8d 45 fc	 lea	 eax, DWORD PTR _OldIrql$[ebp]
  00007	56		 push	 esi
  00008	50		 push	 eax
  00009	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoAcquireCancelSpinLock@4

; 721  : 
; 722  :     SerialDump(
; 723  :         SERDIAG4,
; 724  :         ("SERIAL: Completing wait for irp %x\n",Extension->CurrentWaitIrp)
; 725  :         );
; 726  :     SerialTryToCompleteCurrent(
; 727  :         Extension,
; 728  :         NULL,
; 729  :         OldIrql,
; 730  :         STATUS_SUCCESS,
; 731  :         &Extension->CurrentWaitIrp,
; 732  :         NULL,
; 733  :         NULL,
; 734  :         NULL,
; 735  :         NULL,
; 736  :         NULL,
; 737  :         SERIAL_REF_ISR
; 738  :         );

  0000f	8b 75 0c	 mov	 esi, DWORD PTR _DeferredContext$[ebp]
  00012	33 c0		 xor	 eax, eax
  00014	6a 01		 push	 1
  00016	50		 push	 eax
  00017	50		 push	 eax
  00018	50		 push	 eax
  00019	50		 push	 eax
  0001a	8d 8e d4 00 00
	00		 lea	 ecx, DWORD PTR [esi+212]
  00020	50		 push	 eax
  00021	51		 push	 ecx
  00022	50		 push	 eax
  00023	ff 75 fc	 push	 DWORD PTR _OldIrql$[ebp]
  00026	50		 push	 eax
  00027	56		 push	 esi
  00028	e8 00 00 00 00	 call	 _SerialTryToCompleteCurrent@44

; 739  : 
; 740  :     SerialDpcEpilogue(Extension, Dpc);

  0002d	ff 75 08	 push	 DWORD PTR _Dpc$[ebp]
  00030	56		 push	 esi
  00031	e8 00 00 00 00	 call	 _SerialDpcEpilogue@8
  00036	5e		 pop	 esi

; 741  : }

  00037	c9		 leave
  00038	c2 10 00	 ret	 16			; 00000010H
_SerialCompleteWait@16 ENDP
_TEXT	ENDS
END

⌨️ 快捷键说明

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