94{
97
101
107
112 ULONG OriginalByteCount;
113
115
117
119
121
122
123
124
125
127
130 }
131
132
133
134
135
136
138
139
141
144
147 }
148
149
150
151
152
153
158
159
160
161
162
163
166
168
169
170
171
172
174
176 }
177
178
179
180
181
182
183
184
185
186 if (PagingIo) {
187
189
190 } else {
191
193 }
194
195
196
197
198
200
201
202
203
204
205
208
210 }
211
212
213
214
215
216
217 if (!
Wait && NonCachedIo) {
218
219
220
221
222
224
227 }
228 }
229
230
231
232
233
235
236
237
238
239
240
243 IrpContext,
244 (
PVOID)CdOplockComplete,
245 (
PVOID)CdPrePostIrp );
246
247
248
249
250
251
253
256
258 }
259
260 if (!PagingIo &&
263
265 }
266 }
267
268
269
270
271
272
275
276
277
278
279
281
283 }
284
285
286
287
288
289 if (ByteRange >
Fcb->FileSize.QuadPart) {
290
292 ByteRange =
Fcb->FileSize.QuadPart;
293 }
294 }
295
296
297
298
299
300 if (NonCachedIo) {
301
302
303
304
305
306
307
308
310
313 (ReadByteCount > OriginalByteCount)) {
314
316
318 }
319
320
321
322
323
325 }
326
327
328
329
330
331
332
333 if (IrpContext->IoContext ==
NULL ||
335
336
337
338
339
340
342
343 IrpContext->IoContext = &LocalIoContext;
345
346 } else {
347
350 }
351 }
352
354
355
356
357
358
359
360 IrpContext->IoContext->AllocatedContext =
362
364
368
369 } else {
370
372 IrpContext->IoContext->Resource =
Fcb->Resource;
373 IrpContext->IoContext->RequestedByteCount =
ByteCount;
374 }
375
376 Irp->IoStatus.Information = ReadByteCount;
377
378
379
380
381
382
384
386
387 } else {
388
390 }
391
392
393
394
395
397
400
401
402
403
404
405
406 } else {
407
408
409
410
411
413
414
415
416
417
418 Irp->IoStatus.Information = 0;
419
420
421
422
423
425
427 }
428
430
431
432
433
434
436
438
444
446 }
447
448
449
450
451
453
455 }
456 }
457
459 }
460
461
462
463
464
465
467
468
469
470
471
477
479 }
480
481
482
483
484
486
487
488
489
490
491
492
494
495
496
497
498
503 SystemBuffer,
505
507 }
508
509
510
511
512
514
516 }
517
518
519
520
521
522 } else {
523
529
531 }
532
533
534
535
536
538
540 }
541
544
545
546
547
548
549 if (ReleaseFile) {
550
552 }
554
555
556
557
558
560
561 Status = CdFsdPostRequest( IrpContext,
Irp );
562
563
564
565
566
567 } else {
568
570 }
571
573}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID NTAPI CcMdlRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
VOID NTAPI CcSetReadAheadGranularity(IN PFILE_OBJECT FileObject, IN ULONG Granularity)
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
#define CdMapUserBuffer(IC, UB)
#define CdAcquireFileSharedStarveExclusive(IC, F)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
#define CdReleaseFile(IC, F)
#define CdGetFcbOplock(F)
_In_ PFCB _In_ LONGLONG StartingOffset
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define CdAllocateIoContext()
BOOLEAN CdVerifyFcbOperation(_In_opt_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb)
#define CdNormalizeAndRaiseStatus(IC, S)
#define CdAcquireFileShared(IC, F)
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define CdRaiseStatus(IC, S)
#define FCB_STATE_RAWSECTOR_MASK
#define CCB_FLAG_ALLOW_EXTENDED_DASD_IO
#define IRP_CONTEXT_FLAG_FORCE_POST
#define CCB_FLAG_DISMOUNT_ON_CLOSE
#define IRP_CONTEXT_FLAG_WAIT
#define IRP_CONTEXT_FLAG_ALLOC_IO
#define _Analysis_suppress_lock_checking_(lock)
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
#define KeInitializeEvent(pEvt, foo, foo2)
#define ExGetCurrentResourceThread()
#define ClearFlag(_F, _SF)
#define BooleanFlagOn(F, SF)
BOOLEAN NTAPI FsRtlCheckLockForReadAccess(IN PFILE_LOCK FileLock, IN PIRP Irp)
#define READ_AHEAD_GRANULARITY
#define SafeZeroMemory(AT, BYTE_COUNT)
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
#define Add2Ptr(PTR, INC)
BOOLEAN NTAPI CcCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus)
NTSTATUS NTAPI FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize, IN NTSTATUS NormalizedNtStatus)
#define STATUS_FILE_LOCK_CONFLICT
#define STATUS_UNEXPECTED_IO_ERROR
NTSTATUS NTAPI FsRtlCheckOplock(IN POPLOCK Oplock, IN PIRP Irp, IN PVOID Context, IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL, IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL)
#define STATUS_END_OF_FILE
CACHE_MANAGER_CALLBACKS CacheManagerCallbacks
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@3982 Read
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
_In_ WDFDPC _In_ BOOLEAN Wait
#define IoIsErrorUserInduced(Status)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
#define FO_SYNCHRONOUS_IO