233{
238 SIZE_T NumberBytesRead = 0;
248
249
252
254
259
261
263
267 UDFPrint((
" FSRTL_FSP_TOP_LEVEL_IRP\n"));
268 break;
270 UDFPrint((
" FSRTL_CACHE_TOP_LEVEL_IRP\n"));
271 break;
273 UDFPrint((
" FSRTL_MOD_WRITE_TOP_LEVEL_IRP\n"));
274
275 break;
277 UDFPrint((
" FSRTL_FAST_IO_TOP_LEVEL_IRP\n"));
278
279 break;
281 UDFPrint((
" NULL TOP_LEVEL_IRP\n"));
282 break;
283 default:
286 } else {
287 UDFPrint((
" RECURSIVE_IRP, TOP = %x\n", TopIrp));
288 }
289 break;
290 }
291
294 MmPrint((
" Enter Irp, MDL=%x\n",
Irp->MdlAddress));
295 if(
Irp->MdlAddress) {
297 }
298
299
300
302
303
305
307 }
308
309
310
311
312
315 }
316
319
320
326
330 }
331
332
336 }
337
338
339
340
341
343
349 CanWait ? "W" : "w", PagingIo ? "Pg" : "pg",
350 NonBufferedIo ? "NBuf" : "buff", SynchronousIo ? "Snc" : "Asc"));
351
352 if(!NonBufferedIo &&
358 } else {
362 }
363 }
364
365
368
370 }
372
373
375
376
379 if(!CanWait)
381
382
384
385 UDFPrint((
" UDF_IRP_CONTEXT_FLUSH2_REQUIRED\n"));
387
390 }
391#ifdef UDF_DELAYED_CLOSE
393#endif
394
395 }
396
398
399 UDFPrint((
" UDF_IRP_CONTEXT_FLUSH_REQUIRED\n"));
401
402
404 PtrResourceAcquired = &(
Vcb->VCBResource);
405
407
409 PtrResourceAcquired =
NULL;
410 }
411
412
414 PtrResourceAcquired = &(
Vcb->VCBResource);
415
416#if 0
417 if(PagingIo) {
420 }
421#endif
422
423
424
427 }
429 if(!SystemBuffer) {
431 }
435 &NumberBytesRead);
436 } else {
439 &NumberBytesRead);
440 }
443 }
445
446
447
448
449
450
452 NonBufferedIo =
TRUE;
453 }
454
458 }
459 }
460
461
462
466 }
467
469
471 if(!Res1Acq) {
473 }
475 if(!Res2Acq) {
477 }
478
479#if 0
480 if(PagingIo) {
483 }
484#endif
485
486
487
488
489
490 if (!PagingIo &&
493 }
494
495
496
497
498
499
500
501
502
503
504
505
506
509
511 }
512
513
516
517 }
518 UDFPrint((
" TruncatedLength = %x\n", TruncatedLength));
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536#define UDF_REQ_NOT_VIA_CACHE_MGR(ptr) (!MmIsRecursiveIoFault() && ((ptr)->ImageSectionObject != NULL))
537
538 if(NonBufferedIo &&
540 if(!PagingIo) {
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555 MmPrint((
" CcFlushCache()\n"));
557
558
559
560
561
562
563
564
565
566
567
568
569 if(!Res2Acq) {
572 }
573 }
574 }
575
576
577 if (PagingIo) {
578
579 if(!Res2Acq) {
582 }
583
584 PtrResourceAcquired2 = &(
NtReqFcb->PagingIoResource);
585 }
586 } else {
587
588 if(NonBufferedIo) {
589 if(!Res2Acq) {
592 }
593 PtrResourceAcquired2 = &(
NtReqFcb->PagingIoResource);
594 }
595 } else {
596 if(!Res1Acq) {
600 }
601
602 PtrResourceAcquired = &(
NtReqFcb->MainResource);
603 }
604 }
605 }
606
607
608
609
610
611
612
613
614
616
617
618
619#ifdef UDF_DISABLE_SYSTEM_CACHE_MANAGER
620 NonBufferedIo =
TRUE;
621#endif
622
623 if(
Fcb &&
Fcb->FileInfo &&
Fcb->FileInfo->Dloc) {
624 AdPrint((
"UDFCommonRead: DataLoc %x, Mapping %x\n", &
Fcb->FileInfo->Dloc->DataLoc,
Fcb->FileInfo->Dloc->DataLoc.Mapping));
625 }
626
627
628 if (!NonBufferedIo) {
629
632 }
633
634
636
637
638 MmPrint((
" CcInitializeCacheMap()\n"));
643 MmPrint((
" CcSetReadAheadGranularity()\n"));
645 }
646
647
649
650
652
653
654
655 NumberBytesRead = 0;
657
659 }
660
661
662
663
665 if(!SystemBuffer)
670
671
673 }
674
676
677 RC =
Irp->IoStatus.Status;
678 NumberBytesRead =
Irp->IoStatus.Information;
679
681
682 } else {
683
684 MmPrint((
" Read NonBufferedIo\n"));
685
686#if 1
688 UDFPrint((
"FSRTL_MOD_WRITE_TOP_LEVEL_IRP => CanWait\n"));
690 } else
692 UDFPrint((
"FSRTL_CACHE_TOP_LEVEL_IRP => CanWait\n"));
694 }
695
699 } else
700 {}
701
702
703
704
705#endif
707 MmPrint((
" !PASSIVE_LEVEL\n"));
710 }
712 MmPrint((
" Locked => CanWait\n"));
715 }
716
717
718 if(!CanWait) {
720 }
721
722
723 if(!Res2Acq) {
725 PtrResourceAcquired2 = &(
NtReqFcb->PagingIoResource);
726 }
727
731 }
732
734 if(!SystemBuffer) {
736 }
737
739 CacheLocked, (
PCHAR)SystemBuffer, &NumberBytesRead);
740
741
742
743
744
746
747#if 0
748 if(PagingIo) {
750 } else {
752 }
753#endif
754
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773 }
774
776
778
779 if(CacheLocked) {
781 }
782
783
784 if(PtrResourceAcquired2) {
786 }
787 if(PtrResourceAcquired) {
789 (PtrResourceAcquired ==
792 }
794 }
795
796
798
799
800
804 }
805 if(PagingIo) {
806 if(Res1Acq) {
808 }
809 if(Res2Acq) {
811 }
812 }
813
814
816
817 } else {
818
819
820 if (SynchronousIo && !PagingIo &&
NT_SUCCESS(RC)) {
822 }
823
824
825
829 }
830
832 Irp->IoStatus.Status = RC;
833 Irp->IoStatus.Information = NumberBytesRead;
834 UDFPrint((
" NumberBytesRead = %x\n", NumberBytesRead));
835
837
838 MmPrint((
" Complete Irp, MDL=%x\n",
Irp->MdlAddress));
839 if(
Irp->MdlAddress) {
841 }
843 }
844 }
846
847 return(RC);
848}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID NTAPI CcSetReadAheadGranularity(IN PFILE_OBJECT FileObject, IN ULONG Granularity)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
VOID UDFCloseAllDelayed(IN PVCB Vcb)
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS UDFPostRequest(IN PtrUDFIrpContext PtrIrpContext, IN PIRP Irp)
VOID UDFReleaseIrpContext(PtrUDFIrpContext PtrIrpContext)
ULONG UDFIsResourceAcquired(IN PERESOURCE Resource)
BOOLEAN UDFAcquireResourceSharedWithCheck(IN PERESOURCE Resource)
#define CollectStatistics(VCB, Field)
__inline VOID UDFNotifyFullReportChange(PVCB V, PUDF_FILE_INFO FI, ULONG E, ULONG A)
#define CollectStatisticsEx(VCB, Field, a)
#define CollectStatistics2(VCB, Field)
#define UDFReleaseResource(Resource)
#define UDFAcquireResourceShared(Resource, CanWait)
#define UDFAcquireResourceExclusive(Resource, CanWait)
#define KeGetCurrentIrql()
#define UDFAcquireSharedWaitForExclusive(Resource, CanWait)
FAST_IO_POSSIBLE NTAPI UDFIsFastIoPossible(IN PtrUDFFCB Fcb)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
BOOLEAN NTAPI FsRtlCheckLockForReadAccess(IN PFILE_LOCK FileLock, IN PIRP Irp)
ULONG UDFFlushLogicalVolume(IN PtrUDFIrpContext PtrIrpContext, IN PIRP Irp, IN PVCB Vcb, IN ULONG FlushFlags)
#define FSRTL_FSP_TOP_LEVEL_IRP
#define FSRTL_CACHE_TOP_LEVEL_IRP
#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP
#define FSRTL_FAST_IO_TOP_LEVEL_IRP
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
#define FILE_USE_FILE_POINTER_POSITION
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)
#define IoCompleteRequest
PIRP NTAPI IoGetTopLevelIrp(VOID)
#define STATUS_FILE_LOCK_CONFLICT
OSSTATUS UDFTRead(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T ReadBytes, IN uint32 Flags)
OSSTATUS UDFReadData(IN PVCB Vcb, IN BOOLEAN Translate, IN LONGLONG Offset, IN ULONG Length, IN BOOLEAN Direct, OUT PCHAR Buffer, OUT PSIZE_T ReadBytes)
#define UDFCloseAllSystemDelayedInDir(Vcb, FI)
#define _SEH2_AbnormalTermination()
NTSTATUS UDFLockCallersBuffer(PtrUDFIrpContext PtrIrpContext, PIRP Irp, BOOLEAN IsReadOperation, uint32 Length)
VOID UDFMdlComplete(PtrUDFIrpContext PtrIrpContext, PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN ReadCompletion)
NTSTATUS UDFPostStackOverflowRead(IN PtrUDFIrpContext PtrIrpContext, IN PIRP Irp, IN PtrUDFFCB Fcb)
#define OVERFLOW_READ_THRESHHOLD
PVOID UDFGetCallersBuffer(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
NTSTATUS UDFUnlockCallersBuffer(PtrUDFIrpContext PtrIrpContext, PIRP Irp, PVOID SystemBuffer)
#define STATUS_END_OF_FILE
#define UDF_IRP_CONTEXT_RES1_ACQ
#define UDF_IRP_CONTEXT_FLUSH2_REQUIRED
#define UDF_IRP_CONTEXT_FLUSH_REQUIRED
#define UDF_FCB_PAGE_FILE
#define UDF_IRP_CONTEXT_CAN_BLOCK
#define UDF_IRP_CONTEXT_FORCED_POST
struct _UDFContextControlBlock * PtrUDFCCB
#define UDF_NODE_TYPE_VCB
#define UDF_FCB_DIRECTORY
#define UDF_IRP_CONTEXT_RES2_ACQ
struct _FCB::@729::@732 Fcb
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@3982 Read
#define UDF_VCB_FLAGS_VOLUME_MOUNTED
#define UDF_VCB_FLAGS_RAW_DISK
#define UDF_VCB_SKIP_EJECT_CHECK
#define UDFIsFileCached__(Vcb, FileInfo, Offset, Length, ForWrite)
__inline OSSTATUS UDFReadFile__(IN PVCB Vcb, IN PUDF_FILE_INFO FileInfo, IN int64 Offset, IN SIZE_T Length, IN BOOLEAN Direct, OUT int8 *Buffer, OUT PSIZE_T ReadBytes)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INVALID_USER_BUFFER
#define UDF_CHECK_PAGING_IO_RESOURCE(NTReqFCB)
OSSTATUS WCacheEODirect__(IN PW_CACHE Cache, IN PVOID Context)
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define FILE_ACTION_MODIFIED_STREAM
#define FILE_ACTION_MODIFIED
#define FO_FILE_FAST_IO_READ
#define FILE_NOTIFY_CHANGE_LAST_ACCESS
#define IO_DISK_INCREMENT
#define FO_SYNCHRONOUS_IO