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

📄 legacy.cod

📁 怎样在win2000下构造驱动程序znsoft_Serial2000_demo.ZIP
💻 COD
📖 第 1 页 / 共 5 页
字号:
  00567	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  0056c	8b f0		 mov	 esi, eax

; 619  : 
; 620  :       if (!NT_SUCCESS(status)) {

  0056e	85 f6		 test	 esi, esi
  00570	7d 17		 jge	 SHORT $L15175

; 621  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate ClockRate\n"));

  00572	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  00579	0f 84 43 01 00
	00		 je	 $MigrateLegacyExit$15113
  0057f	68 00 00 00 00	 push	 OFFSET FLAT:$SG15182

; 622  :          goto MigrateLegacyExit;

  00584	e9 33 01 00 00	 jmp	 $L16282
$L15175:

; 623  :       }
; 624  :    }
; 625  : 
; 626  : 
; 627  :    //
; 628  :    // If there is a user index, save it.
; 629  :    //
; 630  : 
; 631  :    if (PUserData->UserIndexed != SERIAL_BAD_VALUE) {

  00589	8d 43 2c	 lea	 eax, DWORD PTR [ebx+44]
  0058c	83 38 ff	 cmp	 DWORD PTR [eax], -1
  0058f	74 2f		 je	 SHORT $L15194

; 632  :       status = SerialPutRegistryKeyValue(pnpKey, L"Indexed", sizeof(L"Indexed"),
; 633  :                                          REG_DWORD, &PUserData->UserIndexed,
; 634  :                                          sizeof(ULONG));

  00591	57		 push	 edi
  00592	50		 push	 eax
  00593	57		 push	 edi
  00594	6a 10		 push	 16			; 00000010H
  00596	68 00 00 00 00	 push	 OFFSET FLAT:$SG15192
  0059b	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  0059e	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  005a3	8b f0		 mov	 esi, eax

; 635  : 
; 636  :       if (!NT_SUCCESS(status)) {

  005a5	85 f6		 test	 esi, esi
  005a7	7d 17		 jge	 SHORT $L15194

; 637  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate Indexed\n"));

  005a9	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  005b0	0f 84 0c 01 00
	00		 je	 $MigrateLegacyExit$15113
  005b6	68 00 00 00 00	 push	 OFFSET FLAT:$SG15201

; 638  :          goto MigrateLegacyExit;

  005bb	e9 fc 00 00 00	 jmp	 $L16282
$L15194:

; 639  :       }
; 640  :    }
; 641  : 
; 642  : 
; 643  :    //
; 644  :    // If the port was disabled, save that.
; 645  :    //
; 646  : 
; 647  :    if (PUserData->DisablePort != SERIAL_BAD_VALUE) {

  005c0	8d 43 40	 lea	 eax, DWORD PTR [ebx+64]
  005c3	83 38 ff	 cmp	 DWORD PTR [eax], -1
  005c6	74 2f		 je	 SHORT $L15213

; 648  :       status = SerialPutRegistryKeyValue(pnpKey, L"DisablePort",
; 649  :                                          sizeof(L"DisablePort"), REG_DWORD,
; 650  :                                          &PUserData->DisablePort,
; 651  :                                          sizeof(ULONG));

  005c8	57		 push	 edi
  005c9	50		 push	 eax
  005ca	57		 push	 edi
  005cb	6a 18		 push	 24			; 00000018H
  005cd	68 00 00 00 00	 push	 OFFSET FLAT:$SG15211
  005d2	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  005d5	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  005da	8b f0		 mov	 esi, eax

; 652  :       if (!NT_SUCCESS(status)) {

  005dc	85 f6		 test	 esi, esi
  005de	7d 17		 jge	 SHORT $L15213

; 653  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate DisablePort\n"));

  005e0	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  005e7	0f 84 d5 00 00
	00		 je	 $MigrateLegacyExit$15113
  005ed	68 00 00 00 00	 push	 OFFSET FLAT:$SG15220

; 654  :          goto MigrateLegacyExit;

  005f2	e9 c5 00 00 00	 jmp	 $L16282
$L15213:

; 655  :       }
; 656  :    }
; 657  : 
; 658  : 
; 659  :    //
; 660  :    // If Fifo's were forced enabled, save that.
; 661  :    //
; 662  :    if (PUserData->ForceFIFOEnable != SERIAL_BAD_VALUE) {

  005f7	8d 43 54	 lea	 eax, DWORD PTR [ebx+84]
  005fa	83 38 ff	 cmp	 DWORD PTR [eax], -1
  005fd	74 2f		 je	 SHORT $L15232

; 663  :       status = SerialPutRegistryKeyValue(pnpKey, L"ForceFifoEnable",
; 664  :                                          sizeof(L"ForceFifoEnable"), REG_DWORD,
; 665  :                                          &PUserData->ForceFIFOEnable,
; 666  :                                          sizeof(ULONG));

  005ff	57		 push	 edi
  00600	50		 push	 eax
  00601	57		 push	 edi
  00602	6a 20		 push	 32			; 00000020H
  00604	68 00 00 00 00	 push	 OFFSET FLAT:$SG15230
  00609	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  0060c	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  00611	8b f0		 mov	 esi, eax

; 667  : 
; 668  :       if (!NT_SUCCESS(status)) {

  00613	85 f6		 test	 esi, esi
  00615	7d 17		 jge	 SHORT $L15232

; 669  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate ForceFifoEnable\n"));

  00617	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  0061e	0f 84 9e 00 00
	00		 je	 $MigrateLegacyExit$15113
  00624	68 00 00 00 00	 push	 OFFSET FLAT:$SG15239

; 670  :          goto MigrateLegacyExit;

  00629	e9 8e 00 00 00	 jmp	 $L16282
$L15232:

; 671  :       }
; 672  :    }
; 673  : 
; 674  : 
; 675  :    //
; 676  :    // If RxFIFO had an override, save that.
; 677  :    //
; 678  : 
; 679  :    if (PUserData->RxFIFO != SERIAL_BAD_VALUE) {

  0062e	8d 43 44	 lea	 eax, DWORD PTR [ebx+68]
  00631	83 38 ff	 cmp	 DWORD PTR [eax], -1
  00634	74 28		 je	 SHORT $L15251

; 680  :       status = SerialPutRegistryKeyValue(pnpKey, L"RxFIFO", sizeof(L"RxFIFO"),
; 681  :                                          REG_DWORD, &PUserData->RxFIFO,
; 682  :                                          sizeof(ULONG));

  00636	57		 push	 edi
  00637	50		 push	 eax
  00638	57		 push	 edi
  00639	6a 0e		 push	 14			; 0000000eH
  0063b	68 00 00 00 00	 push	 OFFSET FLAT:$SG15249
  00640	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  00643	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  00648	8b f0		 mov	 esi, eax

; 683  : 
; 684  :       if (!NT_SUCCESS(status)) {

  0064a	85 f6		 test	 esi, esi
  0064c	7d 10		 jge	 SHORT $L15251

; 685  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate RxFIFO\n"));

  0064e	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  00655	74 6b		 je	 SHORT $MigrateLegacyExit$15113
  00657	68 00 00 00 00	 push	 OFFSET FLAT:$SG15258

; 686  :          goto MigrateLegacyExit;

  0065c	eb 5e		 jmp	 SHORT $L16282
$L15251:

; 687  :       }
; 688  :    }
; 689  : 
; 690  : 
; 691  :    //
; 692  :    // If TxFIFO had an override, save that.
; 693  :    //
; 694  : 
; 695  :    if (PUserData->TxFIFO != SERIAL_BAD_VALUE) {

  0065e	8d 43 4c	 lea	 eax, DWORD PTR [ebx+76]
  00661	83 38 ff	 cmp	 DWORD PTR [eax], -1
  00664	74 28		 je	 SHORT $L15270

; 696  :       status = SerialPutRegistryKeyValue(pnpKey, L"TxFIFO", sizeof(L"TxFIFO"),
; 697  :                                          REG_DWORD, &PUserData->TxFIFO,
; 698  :                                          sizeof(ULONG));

  00666	57		 push	 edi
  00667	50		 push	 eax
  00668	57		 push	 edi
  00669	6a 0e		 push	 14			; 0000000eH
  0066b	68 00 00 00 00	 push	 OFFSET FLAT:$SG15268
  00670	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  00673	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  00678	8b f0		 mov	 esi, eax

; 699  : 
; 700  :       if (!NT_SUCCESS(status)) {

  0067a	85 f6		 test	 esi, esi
  0067c	7d 10		 jge	 SHORT $L15270

; 701  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate TxFIFO\n"));

  0067e	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  00685	74 3b		 je	 SHORT $MigrateLegacyExit$15113
  00687	68 00 00 00 00	 push	 OFFSET FLAT:$SG15277

; 702  :          goto MigrateLegacyExit;

  0068c	eb 2e		 jmp	 SHORT $L16282
$L15270:

; 703  :       }
; 704  :    }
; 705  : 
; 706  : 
; 707  :    //
; 708  :    // If MaskInverted had an override, save that.
; 709  :    //
; 710  : 
; 711  :    if (PUserData->MaskInverted != SERIAL_BAD_VALUE) {

  0068e	83 c3 64	 add	 ebx, 100		; 00000064H
  00691	83 3b ff	 cmp	 DWORD PTR [ebx], -1
  00694	74 2c		 je	 SHORT $MigrateLegacyExit$15113

; 712  :       status = SerialPutRegistryKeyValue(pnpKey, L"MaskInverted",
; 713  :                                          sizeof(L"MaskInverted"), REG_DWORD,
; 714  :                                          &PUserData->MaskInverted,
; 715  :                                          sizeof(ULONG));

  00696	57		 push	 edi
  00697	53		 push	 ebx
  00698	57		 push	 edi
  00699	6a 1a		 push	 26			; 0000001aH
  0069b	68 00 00 00 00	 push	 OFFSET FLAT:$SG15287
  006a0	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  006a3	e8 00 00 00 00	 call	 _SerialPutRegistryKeyValue@24
  006a8	8b f0		 mov	 esi, eax

; 716  :       if (!NT_SUCCESS(status)) {

  006aa	85 f6		 test	 esi, esi
  006ac	7d 14		 jge	 SHORT $MigrateLegacyExit$15113

; 717  :          SerialDump(SERERRORS, ("SERIAL: Couldn't migrate MaskInverted\n"));

  006ae	f6 05 03 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel+3, 64 ; 00000040H
  006b5	74 0b		 je	 SHORT $MigrateLegacyExit$15113
  006b7	68 00 00 00 00	 push	 OFFSET FLAT:$SG15296
$L16282:
  006bc	e8 00 00 00 00	 call	 _DbgPrint
  006c1	59		 pop	 ecx
$MigrateLegacyExit$15113:

; 718  :          goto MigrateLegacyExit;
; 719  :       }
; 720  :    }
; 721  : 
; 722  : 
; 723  :    MigrateLegacyExit:;
; 724  : 
; 725  :    ZwClose(pnpKey);

  006c2	ff 75 fc	 push	 DWORD PTR _pnpKey$[ebp]
  006c5	ff 15 00 00 00
	00		 call	 DWORD PTR __imp__ZwClose@4

; 726  : 
; 727  :    SerialDump(SERTRACECALLS, ("SERIAL: Leave (2) SerialMigrateLegacyRegistry"
; 728  :                               "\n"));

  006cb	f6 05 00 00 00
	00 40		 test	 BYTE PTR _SerialDebugLevel, 64 ; 00000040H
  006d2	74 0b		 je	 SHORT $L15304
  006d4	68 00 00 00 00	 push	 OFFSET FLAT:$SG15309
  006d9	e8 00 00 00 00	 call	 _DbgPrint
  006de	59		 pop	 ecx
$L15304:

; 729  : 
; 730  :    return status;

  006df	8b c6		 mov	 eax, esi
$L15050:
  006e1	5f		 pop	 edi
  006e2	5e		 pop	 esi
  006e3	5b		 pop	 ebx

; 731  : }

  006e4	c9		 leave
  006e5	c2 0c 00	 ret	 12			; 0000000cH
_SerialMigrateLegacyRegistry@12 ENDP
INIT	ENDS
PUBLIC	_SerialIsUserDataValid@20
EXTRN	_SerialItemCallBack@44:NEAR
EXTRN	__imp__wcslen:NEAR
EXTRN	__imp__IoQueryDeviceDescription@32:NEAR
;	COMDAT _SerialIsUserDataValid@20
INIT	SEGMENT
$SG15330 DB	'EX: Pageable code called at IRQL %d', 0aH, 00H
	ORG $+3
$SG15333 DB	'f:\w2ddk\src\kernel\serial\legacy.c', 00H
$SG15334 DB	'FALSE', 00H
	ORG $+2
$SG15341 DB	'SERIAL: Enter SerialIsUserDataValid', 0aH, 00H
	ORG $+3
$SG15361 DB	'SERIAL: Bogus port address %ws', 0aH, 00H
$SG15382 DB	'SERIAL: Bogus vector %ws', 0aH, 00H
	ORG $+2
$SG15402 DB	'SERIAL: bogus value for %ws', 0aH, 00H
	ORG $+3
$SG15422 DB	'SERIAL: Bogus port index %ws', 0aH, 00H
	ORG $+2
$SG15442 DB	'SERIAL: Port index must be > 0 for any', 0aH, '------- p'
	DB	'ort on a multiport card: %ws', 0aH, 00H
	ORG $+2
$SG15463 DB	'SERIAL: port index to large %ws', 0aH, 00H
	ORG $+3
$SG15483 DB	'SERIAL: port index to large %ws', 0aH, 00H
	ORG $+3
$SG15505 DB	'SERIAL: Invalid Bus type %ws', 0aH, 00H
	ORG $+2
$SG15529 DB	'SERIAL: There aren''t that many of those', 0aH, '-------'
	DB	' busses on this system,%ws', 0aH, 00H
	ORG $+5
$SG15548 DB	'SERIAL: Latched interrupts and MicroChannel', 0aH, '----'
	DB	'--- busses don''t mix,%ws', 0aH, 00H
	ORG $+2
$SG15561 DB	'SERIAL: ''user registry info - userPort: %x', 0aH, 00H
$SG15574 DB	'SERIAL: ''user registry info - userInterruptStatus: %x', 0aH
	DB	00H
	ORG $+1
$SG15587 DB	'SERIAL: ''user registry info - userPortIndex: %d', 0aH, 00H
	ORG $+3
$SG15600 DB	'SERIAL: ''user registry info - userClockRate: %d', 0aH, 00H
	ORG $+3
$SG15613 DB	'SERIAL: ''user registry info - userBusNumber: %d', 0aH, 00H
	ORG $+3
$SG15626 DB	'SERIAL: ''user registry info - userAddressSpace: %d', 0aH
	DB	00H
$SG15639 DB	'SERIAL: ''user registry info - userInterruptMode: %d', 0aH
	DB	00H
	ORG $+3
$SG15652 DB	'SERIAL: ''user registry info - userInterfaceType: %d', 0aH
	DB	00H
	ORG $+3
$SG15665 DB	'SERIAL: ''user registry info - userVector: %d', 0aH, 00H
	ORG $+2
$SG15678 DB	'SERIAL: ''user registry info - userLevel: %d', 0aH, 00H
	ORG $+3
$SG15691 DB	'SERIAL: ''user registry info - userIndexed: %d', 0aH, 00H
	ORG $+1
$SG15704 DB	'SERIAL: Leave SerialIsUserDataValid', 0aH, 00H
; Function compile flags: /Ogs
_DriverObject$ = 8
_UserSubKey$ = 12
_Parameters$ = 16
_DefaultInterfaceType$ = 20
_PUserData$ = 24
_zero$ = -8
_rval$ = -1
_foundIt$15492 = 15
_SerialIsUserDataValid@20 PROC N

⌨️ 快捷键说明

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