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

📄 immediat.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 3 页
字号:
  0029e	53		 push	 ebx
  0029f	50		 push	 eax
  002a0	8d 83 28 04 00
	00		 lea	 eax, DWORD PTR [ebx+1064]
  002a6	ff 75 f4	 push	 DWORD PTR _TotalTime$[ebp+4]
  002a9	ff 75 f0	 push	 DWORD PTR _TotalTime$[ebp]
  002ac	50		 push	 eax
  002ad	e8 00 00 00 00	 call	 _SerialSetTimer@20

; 207  : 
; 208  :             //
; 209  :             // Since the timer knows about the irp we increment
; 210  :             // the reference count.
; 211  :             //
; 212  : 
; 213  :             SERIAL_SET_REFERENCE(
; 214  :                 Extension->CurrentImmediateIrp,
; 215  :                 SERIAL_REF_TOTAL_TIMER
; 216  :                 );

  002b2	8b 83 d8 00 00
	00		 mov	 eax, DWORD PTR [ebx+216]
  002b8	8b 70 60	 mov	 esi, DWORD PTR [eax+96]
  002bb	83 c6 10	 add	 esi, 16			; 00000010H
  002be	f6 06 04	 test	 BYTE PTR [esi], 4
  002c1	74 16		 je	 SHORT $L14908
  002c3	57		 push	 edi
  002c4	68 d8 00 00 00	 push	 216			; 000000d8H
  002c9	68 00 00 00 00	 push	 OFFSET FLAT:$SG14910
  002ce	68 00 00 00 00	 push	 OFFSET FLAT:$SG14911
  002d3	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L14908:
  002d9	83 0e 04	 or	 DWORD PTR [esi], 4
$L14904:

; 217  : 
; 218  :         }
; 219  : 
; 220  :         KeSynchronizeExecution(
; 221  :             Extension->Interrupt,
; 222  :             SerialGiveImmediateToIsr,
; 223  :             Extension
; 224  :             );

  002dc	53		 push	 ebx
  002dd	68 00 00 00 00	 push	 OFFSET FLAT:_SerialGiveImmediateToIsr@4
  002e2	ff b3 a0 00 00
	00		 push	 DWORD PTR [ebx+160]
  002e8	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__KeSynchronizeExecution@12

; 225  : 
; 226  :         IoReleaseCancelSpinLock(OldIrql);

  002ee	ff 75 fb	 push	 DWORD PTR _OldIrql$[ebp]
  002f1	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoReleaseCancelSpinLock@4
$L14884:
  002f7	5f		 pop	 edi
  002f8	5e		 pop	 esi
  002f9	5b		 pop	 ebx

; 227  : 
; 228  :     }
; 229  : 
; 230  : }

  002fa	c9		 leave
  002fb	c2 04 00	 ret	 4
_SerialStartImmediate@4 ENDP
PAGESER	ENDS
PUBLIC	_SerialGetNextImmediate@20
PUBLIC	_SerialCompleteImmediate@16
EXTRN	_SerialDpcEpilogue@8:NEAR
EXTRN	_SerialTryToCompleteCurrent@44:NEAR
;	COMDAT _SerialCompleteImmediate@16
_TEXT	SEGMENT
$SG14929 DB	'SERIAL: SerialCompleteImmediate', 0aH, 00H
; Function compile flags: /Ogs
_Dpc$ = 8
_DeferredContext$ = 12
_OldIrql$ = -4
_SerialCompleteImmediate@16 PROC NEAR			; COMDAT

; 240  : {

  00021	55		 push	 ebp
  00022	8b ec		 mov	 ebp, esp
  00024	51		 push	 ecx

; 241  : 
; 242  :     PSERIAL_DEVICE_EXTENSION Extension = DeferredContext;
; 243  :     KIRQL OldIrql;
; 244  : 
; 245  :     UNREFERENCED_PARAMETER(SystemContext1);
; 246  :     UNREFERENCED_PARAMETER(SystemContext2);
; 247  : 
; 248  : 
; 249  :     SerialDump(SERTRACECALLS, ("SERIAL: SerialCompleteImmediate\n"));

  00025	f6 05 00 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel, 64 ; 00000040H
  0002c	74 0b		 je	 SHORT $L14924
  0002e	68 00 00 00 00	 push	 OFFSET FLAT:$SG14929
  00033	e8 00 00 00 00	 call	 _DbgPrint
  00038	59		 pop	 ecx
$L14924:

; 250  : 
; 251  :     IoAcquireCancelSpinLock(&OldIrql);

  00039	8d 45 fc	 lea	 eax, DWORD PTR _OldIrql$[ebp]
  0003c	56		 push	 esi
  0003d	50		 push	 eax
  0003e	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoAcquireCancelSpinLock@4

; 252  : 
; 253  :     SerialTryToCompleteCurrent(
; 254  :         Extension,
; 255  :         NULL,
; 256  :         OldIrql,
; 257  :         STATUS_SUCCESS,
; 258  :         &Extension->CurrentImmediateIrp,
; 259  :         NULL,
; 260  :         NULL,
; 261  :         &Extension->ImmediateTotalTimer,
; 262  :         NULL,
; 263  :         SerialGetNextImmediate,
; 264  :         SERIAL_REF_ISR
; 265  :         );

  00044	8b 75 0c	 mov	 esi, DWORD PTR _DeferredContext$[ebp]
  00047	6a 01		 push	 1
  00049	33 c0		 xor	 eax, eax
  0004b	68 00 00 00 00	 push	 OFFSET FLAT:_SerialGetNextImmediate@20
  00050	8d 8e 28 04 00
	00		 lea	 ecx, DWORD PTR [esi+1064]
  00056	50		 push	 eax
  00057	51		 push	 ecx
  00058	50		 push	 eax
  00059	8d 8e d8 00 00
	00		 lea	 ecx, DWORD PTR [esi+216]
  0005f	50		 push	 eax
  00060	51		 push	 ecx
  00061	50		 push	 eax
  00062	ff 75 fc	 push	 DWORD PTR _OldIrql$[ebp]
  00065	50		 push	 eax
  00066	56		 push	 esi
  00067	e8 00 00 00 00	 call	 _SerialTryToCompleteCurrent@44

; 266  : 
; 267  :     SerialDpcEpilogue(Extension, Dpc);

  0006c	ff 75 08	 push	 DWORD PTR _Dpc$[ebp]
  0006f	56		 push	 esi
  00070	e8 00 00 00 00	 call	 _SerialDpcEpilogue@8
  00075	5e		 pop	 esi

; 268  : 
; 269  : }

  00076	c9		 leave
  00077	c2 10 00	 ret	 16			; 00000010H
_SerialCompleteImmediate@16 ENDP
_TEXT	ENDS
PUBLIC	_SerialGrabImmediateFromIsr@4
PUBLIC	_SerialTimeoutImmediate@16
;	COMDAT _SerialTimeoutImmediate@16
_TEXT	SEGMENT
$SG14958 DB	'SERIAL: SerialTimeoutImmediate', 0aH, 00H
; Function compile flags: /Ogs
_Dpc$ = 8
_DeferredContext$ = 12
_OldIrql$ = -4
_SerialTimeoutImmediate@16 PROC NEAR			; COMDAT

; 279  : {

  00020	55		 push	 ebp
  00021	8b ec		 mov	 ebp, esp
  00023	51		 push	 ecx

; 280  : 
; 281  :     PSERIAL_DEVICE_EXTENSION Extension = DeferredContext;
; 282  :     KIRQL OldIrql;
; 283  : 
; 284  :     UNREFERENCED_PARAMETER(SystemContext1);
; 285  :     UNREFERENCED_PARAMETER(SystemContext2);
; 286  : 
; 287  : 
; 288  :     SerialDump(SERTRACECALLS, ("SERIAL: SerialTimeoutImmediate\n"));

  00024	f6 05 00 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel, 64 ; 00000040H
  0002b	74 0b		 je	 SHORT $L14953
  0002d	68 00 00 00 00	 push	 OFFSET FLAT:$SG14958
  00032	e8 00 00 00 00	 call	 _DbgPrint
  00037	59		 pop	 ecx
$L14953:

; 289  : 
; 290  :     IoAcquireCancelSpinLock(&OldIrql);

  00038	8d 45 fc	 lea	 eax, DWORD PTR _OldIrql$[ebp]
  0003b	56		 push	 esi
  0003c	50		 push	 eax
  0003d	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoAcquireCancelSpinLock@4

; 291  : 
; 292  :     SerialTryToCompleteCurrent(
; 293  :         Extension,
; 294  :         SerialGrabImmediateFromIsr,
; 295  :         OldIrql,
; 296  :         STATUS_TIMEOUT,
; 297  :         &Extension->CurrentImmediateIrp,
; 298  :         NULL,
; 299  :         NULL,
; 300  :         &Extension->ImmediateTotalTimer,
; 301  :         NULL,
; 302  :         SerialGetNextImmediate,
; 303  :         SERIAL_REF_TOTAL_TIMER
; 304  :         );

  00043	8b 75 0c	 mov	 esi, DWORD PTR _DeferredContext$[ebp]
  00046	6a 04		 push	 4
  00048	33 c0		 xor	 eax, eax
  0004a	68 00 00 00 00	 push	 OFFSET FLAT:_SerialGetNextImmediate@20
  0004f	8d 8e 28 04 00
	00		 lea	 ecx, DWORD PTR [esi+1064]
  00055	50		 push	 eax
  00056	51		 push	 ecx
  00057	50		 push	 eax
  00058	50		 push	 eax
  00059	8d 86 d8 00 00
	00		 lea	 eax, DWORD PTR [esi+216]
  0005f	50		 push	 eax
  00060	68 02 01 00 00	 push	 258			; 00000102H
  00065	ff 75 fc	 push	 DWORD PTR _OldIrql$[ebp]
  00068	68 00 00 00 00	 push	 OFFSET FLAT:_SerialGrabImmediateFromIsr@4
  0006d	56		 push	 esi
  0006e	e8 00 00 00 00	 call	 _SerialTryToCompleteCurrent@44

; 305  : 
; 306  :     SerialDpcEpilogue(Extension, Dpc);

  00073	ff 75 08	 push	 DWORD PTR _Dpc$[ebp]
  00076	56		 push	 esi
  00077	e8 00 00 00 00	 call	 _SerialDpcEpilogue@8
  0007c	5e		 pop	 esi

; 307  : }

  0007d	c9		 leave
  0007e	c2 10 00	 ret	 16			; 00000010H
_SerialTimeoutImmediate@16 ENDP
_TEXT	ENDS
EXTRN	_SerialProcessEmptyTransmit@4:NEAR
;	COMDAT _SerialGetNextImmediate@20
PAGESER	SEGMENT
$SG14983 DB	'SERIAL: Pageable code called at IRQL %d without lock ', 0aH
	DB	00H
	ORG $+1
$SG14986 DB	'f:\w2ddk\src\kernel\serial\immediat.c', 00H
	ORG $+2
$SG14987 DB	'FALSE', 00H
	ORG $+2
$SG14990 DB	'f:\w2ddk\src\kernel\serial\immediat.c', 00H
	ORG $+2
$SG14991 DB	'Extension->TotalCharsQueued >= 1', 00H
	ORG $+3
$SG15000 DB	'SERIAL: Complete Irp: %x', 0aH, 00H
; Function compile flags: /Ogs
_CurrentOpIrp$ = 8
_NewIrp$ = 16
_Extension$ = 24
_OldIrql$ = -4
_OldIrp$ = 8
_SerialGetNextImmediate@20 PROC NEAR			; COMDAT

; 347  : {

  000ce	55		 push	 ebp
  000cf	8b ec		 mov	 ebp, esp
  000d1	51		 push	 ecx
  000d2	53		 push	 ebx

; 348  : 
; 349  :     KIRQL OldIrql;
; 350  : //    PSERIAL_DEVICE_EXTENSION Extension = CONTAINING_RECORD(
; 351  : //                                             CurrentOpIrp,
; 352  : //                                             SERIAL_DEVICE_EXTENSION,
; 353  : //                                             CurrentImmediateIrp
; 354  : //                                             );
; 355  :     PIRP OldIrp = *CurrentOpIrp;

  000d3	8b 5d 08	 mov	 ebx, DWORD PTR _CurrentOpIrp$[ebp]
  000d6	56		 push	 esi

; 356  : 
; 357  :     UNREFERENCED_PARAMETER(QueueToProcess);
; 358  :     UNREFERENCED_PARAMETER(CompleteCurrent);
; 359  :     SERIAL_LOCKED_PAGED_CODE();

  000d7	8b 35 00 00 00
	00		 mov	 esi, DWORD PTR __imp__KeGetCurrentIrql@0
  000dd	8b 03		 mov	 eax, DWORD PTR [ebx]
  000df	57		 push	 edi
  000e0	89 45 08	 mov	 DWORD PTR _OldIrp$[ebp], eax
  000e3	ff d6		 call	 esi
  000e5	3c 01		 cmp	 al, 1
  000e7	76 32		 jbe	 SHORT $L14984
  000e9	83 3d 14 00 00
	00 00		 cmp	 DWORD PTR _SerialGlobals+20, 0
  000f0	75 29		 jne	 SHORT $L14984
  000f2	ff d6		 call	 esi
  000f4	0f b6 c0	 movzx	 eax, al
  000f7	50		 push	 eax
  000f8	68 00 00 00 00	 push	 OFFSET FLAT:$SG14983
  000fd	e8 00 00 00 00	 call	 _DbgPrint
  00102	59		 pop	 ecx
  00103	59		 pop	 ecx
  00104	6a 00		 push	 0
  00106	68 67 01 00 00	 push	 359			; 00000167H
  0010b	68 00 00 00 00	 push	 OFFSET FLAT:$SG14986
  00110	68 00 00 00 00	 push	 OFFSET FLAT:$SG14987
  00115	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L14984:

; 360  : 
; 361  :     IoAcquireCancelSpinLock(&OldIrql);

  0011b	8d 45 fc	 lea	 eax, DWORD PTR _OldIrql$[ebp]
  0011e	50		 push	 eax
  0011f	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoAcquireCancelSpinLock@4

; 362  : 
; 363  :     ASSERT(Extension->TotalCharsQueued >= 1);

  00125	8b 7d 18	 mov	 edi, DWORD PTR _Extension$[ebp]
  00128	8d b7 28 01 00
	00		 lea	 esi, DWORD PTR [edi+296]
  0012e	83 3e 01	 cmp	 DWORD PTR [esi], 1
  00131	73 17		 jae	 SHORT $L14988
  00133	6a 00		 push	 0
  00135	68 6b 01 00 00	 push	 363			; 0000016bH
  0013a	68 00 00 00 00	 push	 OFFSET FLAT:$SG14990
  0013f	68 00 00 00 00	 push	 OFFSET FLAT:$SG14991
  00144	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__RtlAssert@16
$L14988:

; 364  :     Extension->TotalCharsQueued--;
; 365  : 
; 366  :     *CurrentOpIrp = NULL;
; 367  :     *NewIrp = NULL;

  0014a	8b 45 10	 mov	 eax, DWORD PTR _NewIrp$[ebp]
  0014d	ff 0e		 dec	 DWORD PTR [esi]
  0014f	83 23 00	 and	 DWORD PTR [ebx], 0

; 368  :     KeSynchronizeExecution(
; 369  :         Extension->Interrupt,
; 370  :         SerialProcessEmptyTransmit,
; 371  :         Extension
; 372  :         );

  00152	57		 push	 edi
  00153	83 20 00	 and	 DWORD PTR [eax], 0
  00156	68 00 00 00 00	 push	 OFFSET FLAT:_SerialProcessEmptyTransmit@4
  0015b	ff b7 a0 00 00
	00		 push	 DWORD PTR [edi+160]
  00161	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__KeSynchronizeExecution@12

; 373  :     IoReleaseCancelSpinLock(OldIrql);

  00167	ff 75 fc	 push	 DWORD PTR _OldIrql$[ebp]
  0016a	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__IoReleaseCancelSpinLock@4

; 374  : 
; 375  :     SerialDump(
; 376  :         SERIRPPATH,
; 377  :         ("SERIAL: Complete Irp: %x\n",OldIrp)
; 378  :         );

  00170	f6 05 00 00 00
	00 20		 test	 BYTE PTR _SerialDebugLevel, 32 ; 00000020H
  00177	74 0f		 je	 SHORT $L14995
  00179	ff 75 08	 push	 DWORD PTR _OldIrp$[ebp]
  0017c	68 00 00 00 00	 push	 OFFSET FLAT:$SG15000
  00181	e8 00 00 00 00	 call	 _DbgPrint
  00186	59		 pop	 ecx

⌨️ 快捷键说明

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