53#define BugCheckFileId (CDFS_BUG_CHECK_ALLOCSUP)
76#pragma alloc_text(PAGE, CdAddInitialAllocation)
77#pragma alloc_text(PAGE, CdAddAllocationFromDirent)
78#pragma alloc_text(PAGE, CdDiskOffsetFromMcbEntry)
79#pragma alloc_text(PAGE, CdFindMcbEntry)
80#pragma alloc_text(PAGE, CdInitializeMcb)
81#pragma alloc_text(PAGE, CdLookupAllocation)
82#pragma alloc_text(PAGE, CdTruncateAllocation)
83#pragma alloc_text(PAGE, CdUninitializeMcb)
91#pragma warning(suppress: 6001 6101)
135 ULONG McbEntryOffset;
142 ULONG CurrentMcbOffset;
192 if (McbEntryOffset < Fcb->
Mcb.CurrentEntryCount) {
206 }
else if (!FirstPass) {
229 CleanupParent =
TRUE;
242 CurrentFileOffset = 0;
243 CurrentMcbOffset = 0;
301 CurrentFileOffset += CurrentMcbEntry->
ByteCount;
302 CurrentMcbOffset += 1;
455 if (
Dirent->FileUnitSize != 0) {
603 ULONG McbEntryOffset;
761 ULONG CurrentMcbOffset;
776 CurrentMcbOffset = 0;
779 while (CurrentMcbOffset < Fcb->
Mcb.CurrentEntryCount) {
794 CurrentMcbOffset += 1;
795 CurrentMcbEntry += 1;
803 return CurrentMcbOffset;
869 ExtentOffset =
FileOffset - McbEntry->FileOffset;
875 if (McbEntry->ByteCount == McbEntry->DataBlockByteCount) {
877 *
DiskOffset = McbEntry->DiskOffset + ExtentOffset;
879 LocalByteCount = McbEntry->ByteCount - ExtentOffset;
888 CurrentExtentOffset = McbEntry->DataBlockByteCount;
889 CurrentDiskOffset = McbEntry->DiskOffset;
891 while (CurrentExtentOffset <= ExtentOffset) {
893 CurrentDiskOffset += McbEntry->TotalBlockByteCount;
894 CurrentExtentOffset += McbEntry->DataBlockByteCount;
905 *
DiskOffset = CurrentDiskOffset + (ExtentOffset + McbEntry->DataBlockByteCount - CurrentExtentOffset);
912 if (CurrentExtentOffset > McbEntry->ByteCount) {
914 CurrentExtentOffset = McbEntry->ByteCount;
917 LocalByteCount = CurrentExtentOffset - ExtentOffset;
#define CD_ATTRIBUTE_MULTI
#define ASSERT_IRP_CONTEXT(IC)
#define ASSERT_LOCKED_FCB(F)
VOID CdTruncateAllocation(_In_ PIRP_CONTEXT IrpContext, _Inout_ PFCB Fcb, _In_ LONGLONG StartingFileOffset)
VOID CdAddAllocationFromDirent(_In_ PIRP_CONTEXT IrpContext, _Inout_ PFCB Fcb, _In_ ULONG McbEntryOffset, _In_ LONGLONG StartingFileOffset, _In_ PDIRENT Dirent)
ULONG CdFindMcbEntry(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _In_ LONGLONG FileOffset)
VOID CdDiskOffsetFromMcbEntry(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_MCB_ENTRY McbEntry, _In_ LONGLONG FileOffset, _Out_ PLONGLONG DiskOffset, _Out_ PULONG ByteCount)
VOID CdAddInitialAllocation(_In_ PIRP_CONTEXT IrpContext, _Inout_ PFCB Fcb, _In_ ULONG StartingBlock, _In_ LONGLONG DataLength)
_In_ PFCB _In_ LONGLONG _Out_ PLONGLONG DiskOffset
#define CdInitializeDirent(IC, D)
_In_ PFCB _In_ LONGLONG FileOffset
static INLINE VOID CdVerifyOrCreateDirStreamFile(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb)
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT _Inout_ PDIRENT Dirent
#define CdReleaseFile(IC, F)
#define LlBytesFromBlocks(V, B)
BOOLEAN CdLookupNextDirent(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _In_ PDIRENT_ENUM_CONTEXT CurrentDirContext, _Inout_ PDIRENT_ENUM_CONTEXT NextDirContext)
#define CdCleanupDirContext(IC, DC)
VOID CdLookupDirent(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _In_ ULONG DirentOffset, _Out_ PDIRENT_ENUM_CONTEXT DirContext)
#define CdCleanupDirent(IC, D)
#define CdInitializeDirContext(IC, DC)
#define CdAcquireFileShared(IC, F)
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
#define CdUnlockFcb(IC, F)
#define CdRaiseStatus(IC, S)
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
#define CdQueryFidDirentOffset(I)
struct _CD_MCB_ENTRY CD_MCB_ENTRY
#define _Requires_lock_held_(lock)
#define CDFS_NTC_FCB_PATH_TABLE
#define CDFS_NTC_FCB_INDEX
#define CDFS_NTC_FCB_DATA
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
#define _At_(target, annos)
#define _Inout_updates_bytes_(size)
#define _When_(expr, annos)
#define _In_range_(lb, ub)
#define UNREFERENCED_PARAMETER(P)
__GNU_EXTENSION typedef __int64 * PLONGLONG
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
LONGLONG TotalBlockByteCount
LONGLONG DataBlockByteCount
struct _CD_MCB_ENTRY * McbArray
struct _FCB * VolumeDasdFcb
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_DISK_CORRUPT_ERROR
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount