📄 qsfile.cod
字号:
; Listing generated by Microsoft (R) Optimizing Compiler Version 12.00.9044.0
TITLE F:\W2DDK\src\kernel\serial\qsfile.c
.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
$$SYMBOLS SEGMENT BYTE USE32 'DEBSYM'
$$SYMBOLS ENDS
$$TYPES SEGMENT BYTE USE32 'DEBTYP'
$$TYPES ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
PAGESRP0 SEGMENT PARA USE32 PUBLIC ''
PAGESRP0 ENDS
; COMDAT _RtlConvertLongToLargeInteger@4
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
; COMDAT _SerialQueryInformationFile@8
PAGESRP0 SEGMENT PARA USE32 PUBLIC ''
PAGESRP0 ENDS
; COMDAT _SerialSetInformationFile@8
PAGESRP0 SEGMENT PARA USE32 PUBLIC ''
PAGESRP0 ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
INCLUDELIB LIBC
INCLUDELIB OLDNAMES
PUBLIC _SerialQueryInformationFile@8
EXTRN _SerialIRPPrologue@8:NEAR
EXTRN _SerialIRPEpilogue@4:NEAR
EXTRN __imp_@IofCompleteRequest@8:NEAR
EXTRN _SerialCompleteIfError@8:NEAR
; Function compile flags: /Ogsy
; File f:\w2ddk\src\kernel\serial\qsfile.c
; COMDAT _SerialQueryInformationFile@8
PAGESRP0 SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_SerialQueryInformationFile@8 PROC NEAR ; COMDAT
; 60 : {
00000 53 push ebx
00001 56 push esi
; 61 : //
; 62 : // The status that gets returned to the caller and
; 63 : // set in the Irp.
; 64 : //
; 65 : NTSTATUS Status;
; 66 :
; 67 : //
; 68 : // The current stack location. This contains all of the
; 69 : // information we need to process this particular request.
; 70 : //
; 71 : PIO_STACK_LOCATION IrpSp;
; 72 :
; 73 : NTSTATUS status;
; 74 :
; 75 : UNREFERENCED_PARAMETER(DeviceObject);
; 76 :
; 77 : PAGED_CODE();
; 78 :
; 79 : if ((status = SerialIRPPrologue(Irp,
; 80 : (PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 81 : DeviceExtension)) != STATUS_SUCCESS) {
00002 8b 74 24 10 mov esi, DWORD PTR _Irp$[esp+4]
00006 57 push edi
00007 8b 7c 24 10 mov edi, DWORD PTR _DeviceObject$[esp+8]
0000b ff 77 28 push DWORD PTR [edi+40]
0000e 56 push esi
0000f e8 00 00 00 00 call _SerialIRPPrologue@8
00014 33 db xor ebx, ebx
00016 3b c3 cmp eax, ebx
00018 75 60 jne SHORT $L14838
; 82 : SerialCompleteRequest((PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 83 : DeviceExtension, Irp, IO_NO_INCREMENT);
; 84 : return status;
; 85 : }
; 86 :
; 87 : SerialDump(
; 88 : SERIRPPATH,
; 89 : ("SERIAL: Dispatch entry for: %x\n",Irp)
; 90 : );
; 91 : if (SerialCompleteIfError(
; 92 : DeviceObject,
; 93 : Irp
; 94 : ) != STATUS_SUCCESS) {
0001a 56 push esi
0001b 57 push edi
0001c e8 00 00 00 00 call _SerialCompleteIfError@8
00021 85 c0 test eax, eax
00023 74 07 je SHORT $L14781
; 95 :
; 96 : return STATUS_CANCELLED;
00025 b8 20 01 00 c0 mov eax, -1073741536 ; c0000120H
0002a eb 64 jmp SHORT $L14769
$L14781:
; 97 :
; 98 : }
; 99 : IrpSp = IoGetCurrentIrpStackLocation(Irp);
0002c 8b 46 60 mov eax, DWORD PTR [esi+96]
; 100 : Irp->IoStatus.Information = 0L;
0002f 89 5e 1c mov DWORD PTR [esi+28], ebx
; 101 : Status = STATUS_SUCCESS;
; 102 : if (IrpSp->Parameters.QueryFile.FileInformationClass ==
; 103 : FileStandardInformation) {
00032 8b 40 08 mov eax, DWORD PTR [eax+8]
00035 83 f8 05 cmp eax, 5
00038 75 22 jne SHORT $L14784
; 104 :
; 105 : PFILE_STANDARD_INFORMATION Buf = Irp->AssociatedIrp.SystemBuffer;
0003a 8b 46 0c mov eax, DWORD PTR [esi+12]
; 106 :
; 107 : Buf->AllocationSize.QuadPart = 0;
; 108 : Buf->EndOfFile = Buf->AllocationSize;
0003d 8b cb mov ecx, ebx
0003f 89 18 mov DWORD PTR [eax], ebx
00041 89 58 04 mov DWORD PTR [eax+4], ebx
00044 89 48 08 mov DWORD PTR [eax+8], ecx
00047 89 48 0c mov DWORD PTR [eax+12], ecx
; 109 : Buf->NumberOfLinks = 0;
0004a 89 58 10 mov DWORD PTR [eax+16], ebx
; 110 : Buf->DeletePending = FALSE;
0004d 88 58 14 mov BYTE PTR [eax+20], bl
; 111 : Buf->Directory = FALSE;
00050 88 58 15 mov BYTE PTR [eax+21], bl
; 112 : Irp->IoStatus.Information = sizeof(FILE_STANDARD_INFORMATION);
00053 c7 46 1c 18 00
00 00 mov DWORD PTR [esi+28], 24 ; 00000018H
; 113 :
; 114 : } else if (IrpSp->Parameters.QueryFile.FileInformationClass ==
0005a eb 20 jmp SHORT $L14837
$L14784:
; 115 : FilePositionInformation) {
0005c 83 f8 0e cmp eax, 14 ; 0000000eH
0005f 75 11 jne SHORT $L14788
; 116 :
; 117 : ((PFILE_POSITION_INFORMATION)Irp->AssociatedIrp.SystemBuffer)->
; 118 : CurrentByteOffset.QuadPart = 0;
00061 8b 46 0c mov eax, DWORD PTR [esi+12]
00064 89 18 mov DWORD PTR [eax], ebx
00066 89 58 04 mov DWORD PTR [eax+4], ebx
; 119 : Irp->IoStatus.Information = sizeof(FILE_POSITION_INFORMATION);
00069 c7 46 1c 08 00
00 00 mov DWORD PTR [esi+28], 8
; 120 :
; 121 : } else {
00070 eb 0a jmp SHORT $L14837
$L14788:
; 122 : Status = STATUS_INVALID_PARAMETER;
00072 b8 0d 00 00 c0 mov eax, -1073741811 ; c000000dH
; 123 : Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
00077 89 46 18 mov DWORD PTR [esi+24], eax
$L14838:
; 122 : Status = STATUS_INVALID_PARAMETER;
0007a 8b d8 mov ebx, eax
$L14837:
; 124 : }
; 125 :
; 126 : SerialDump(
; 127 : SERIRPPATH,
; 128 : ("SERIAL: Complete Irp: %x\n",Irp)
; 129 : );
; 130 : SerialCompleteRequest((PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 131 : DeviceExtension, Irp, 0);
0007c 32 d2 xor dl, dl
0007e 8b ce mov ecx, esi
00080 ff 15 00 00 00
00 call DWORD PTR __imp_@IofCompleteRequest@8
00086 ff 77 28 push DWORD PTR [edi+40]
00089 e8 00 00 00 00 call _SerialIRPEpilogue@4
; 132 : return Status;
0008e 8b c3 mov eax, ebx
$L14769:
00090 5f pop edi
00091 5e pop esi
00092 5b pop ebx
; 133 :
; 134 : }
00093 c2 08 00 ret 8
_SerialQueryInformationFile@8 ENDP
PAGESRP0 ENDS
PUBLIC _SerialSetInformationFile@8
; Function compile flags: /Ogsy
; COMDAT _SerialSetInformationFile@8
PAGESRP0 SEGMENT
_DeviceObject$ = 8
_Irp$ = 12
_SerialSetInformationFile@8 PROC NEAR ; COMDAT
; 165 : {
00000 53 push ebx
00001 56 push esi
; 166 : //
; 167 : // The status that gets returned to the caller and
; 168 : // set in the Irp.
; 169 : //
; 170 : NTSTATUS Status;
; 171 :
; 172 : UNREFERENCED_PARAMETER(DeviceObject);
; 173 :
; 174 : PAGED_CODE();
; 175 :
; 176 : if ((Status = SerialIRPPrologue(Irp,
; 177 : (PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 178 : DeviceExtension)) != STATUS_SUCCESS) {
00002 8b 74 24 10 mov esi, DWORD PTR _Irp$[esp+4]
00006 57 push edi
00007 8b 7c 24 10 mov edi, DWORD PTR _DeviceObject$[esp+8]
0000b ff 77 28 push DWORD PTR [edi+40]
0000e 56 push esi
0000f e8 00 00 00 00 call _SerialIRPPrologue@8
00014 8b d8 mov ebx, eax
00016 85 db test ebx, ebx
; 179 : SerialCompleteRequest((PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 180 : DeviceExtension, Irp, IO_NO_INCREMENT);
; 181 : return Status;
00018 75 2f jne SHORT $L14844
; 182 : }
; 183 :
; 184 : SerialDump(
; 185 : SERIRPPATH,
; 186 : ("SERIAL: Dispatch entry for: %x\n",Irp)
; 187 : );
; 188 : if (SerialCompleteIfError(
; 189 : DeviceObject,
; 190 : Irp
; 191 : ) != STATUS_SUCCESS) {
0001a 56 push esi
0001b 57 push edi
0001c e8 00 00 00 00 call _SerialCompleteIfError@8
00021 85 c0 test eax, eax
00023 74 07 je SHORT $L14812
; 192 :
; 193 : return STATUS_CANCELLED;
00025 b8 20 01 00 c0 mov eax, -1073741536 ; c0000120H
0002a eb 31 jmp SHORT $L14802
$L14812:
; 194 :
; 195 : }
; 196 : Irp->IoStatus.Information = 0L;
; 197 : if ((IoGetCurrentIrpStackLocation(Irp)->
; 198 : Parameters.SetFile.FileInformationClass ==
; 199 : FileEndOfFileInformation) ||
; 200 : (IoGetCurrentIrpStackLocation(Irp)->
; 201 : Parameters.SetFile.FileInformationClass ==
; 202 : FileAllocationInformation)) {
0002c 8b 46 60 mov eax, DWORD PTR [esi+96]
0002f 33 db xor ebx, ebx
00031 89 5e 1c mov DWORD PTR [esi+28], ebx
00034 8b 40 08 mov eax, DWORD PTR [eax+8]
00037 83 f8 14 cmp eax, 20 ; 00000014H
0003a 74 0a je SHORT $L14817
0003c 83 f8 13 cmp eax, 19 ; 00000013H
0003f 74 05 je SHORT $L14817
; 203 :
; 204 : Status = STATUS_SUCCESS;
; 205 :
; 206 : } else {
; 207 :
; 208 : Status = STATUS_INVALID_PARAMETER;
00041 bb 0d 00 00 c0 mov ebx, -1073741811 ; c000000dH
$L14817:
; 209 :
; 210 : }
; 211 :
; 212 : Irp->IoStatus.Status = Status;
00046 89 5e 18 mov DWORD PTR [esi+24], ebx
$L14844:
; 213 :
; 214 : SerialDump(
; 215 : SERIRPPATH,
; 216 : ("SERIAL: Complete Irp: %x\n",Irp)
; 217 : );
; 218 : SerialCompleteRequest((PSERIAL_DEVICE_EXTENSION)DeviceObject->
; 219 : DeviceExtension, Irp, 0);
00049 8b ce mov ecx, esi
0004b 32 d2 xor dl, dl
0004d ff 15 00 00 00
00 call DWORD PTR __imp_@IofCompleteRequest@8
00053 ff 77 28 push DWORD PTR [edi+40]
00056 e8 00 00 00 00 call _SerialIRPEpilogue@4
; 220 :
; 221 : return Status;
0005b 8b c3 mov eax, ebx
$L14802:
0005d 5f pop edi
0005e 5e pop esi
0005f 5b pop ebx
; 222 :
; 223 : }
00060 c2 08 00 ret 8
_SerialSetInformationFile@8 ENDP
PAGESRP0 ENDS
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -