82#define BugCheckFileId (CDFS_BUG_CHECK_PATHSUP)
96#define CdRawPathEntry(IC, PC) \
97 Add2Ptr( (PC)->Data, (PC)->DataOffset, PRAW_PATH_ENTRY )
113CdUpdatePathEntryFromRawPathEntry (
122#pragma alloc_text(PAGE, CdFindPathEntry)
123#pragma alloc_text(PAGE, CdLookupPathEntry)
124#pragma alloc_text(PAGE, CdLookupNextPathEntry)
125#pragma alloc_text(PAGE, CdMapPathTableBlock)
126#pragma alloc_text(PAGE, CdUpdatePathEntryFromRawPathEntry)
127#pragma alloc_text(PAGE, CdUpdatePathEntryName)
184 IrpContext->Vcb->PathTableFcb,
198 (
VOID) CdUpdatePathEntryFromRawPathEntry( IrpContext,
252 PathContext->DataOffset += PathEntry->PathEntryLength;
259 if (PathContext->LastDataBlock) {
261 if (PathContext->DataOffset >= PathContext->DataLength) {
272 }
else if (PathContext->DataOffset >=
SECTOR_SIZE) {
274 CurrentBaseOffset = PathContext->BaseOffset +
SECTOR_SIZE;
277 IrpContext->Vcb->PathTableFcb,
293 return CdUpdatePathEntryFromRawPathEntry( IrpContext,
294 PathEntry->Ordinal + 1,
342 ULONG StartingOrdinal;
372 if (
ParentFcb->ChildPathTableOffset != 0) {
375 StartingOrdinal =
ParentFcb->ChildOrdinal;
376 UpdateChildOffset =
FALSE;
380 UpdateChildOffset =
FALSE;
403 if (UpdateChildOffset) {
408 ParentFcb->ChildOrdinal = StartingOrdinal;
426 if (UpdateChildOffset) {
435 UpdateChildOffset =
FALSE;
532 if (CurrentLength >= (
ULONG) (
Fcb->FileSize.QuadPart - BaseOffset)) {
534 CurrentLength = (
ULONG) (
Fcb->FileSize.QuadPart - BaseOffset);
541 PathContext->LastDataBlock =
TRUE;
548 PathContext->BaseOffset = (
ULONG) BaseOffset;
549 PathContext->DataLength = CurrentLength;
581 PathContext->AllocatedData =
TRUE;
583 while (PassCount--) {
614 if (PathContext->AllocatedData) {
617 PathContext->AllocatedData =
FALSE;
625 &PathContext->Data );
637CdUpdatePathEntryFromRawPathEntry (
676 ULONG RemainingDataLength;
686 PathEntry->DirNameLen =
CdRawPathIdLen( IrpContext, RawPathEntry );
688 if (0 == PathEntry->DirNameLen) {
698 if ( PathContext->LastDataBlock &&
699 (0 ==
BlockOffset( IrpContext->Vcb, PathContext->DataLength))) {
712 if (PathContext->LastDataBlock && VerifyBounds) {
720 RemainingDataLength = PathContext->DataLength - PathContext->DataOffset;
745 PathEntry->Ordinal = Ordinal;
746 PathEntry->PathTableOffset = PathContext->BaseOffset + PathContext->DataOffset;
758 PathEntry->DiskOffset +=
CdRawPathXar( IrpContext, RawPathEntry );
768 PathEntry->PathEntryLength =
WordAlign( PathEntry->PathEntryLength );
770 PathEntry->DirName = (
PCHAR)RawPathEntry->
DirId;
827 if ((*PathEntry->DirName == 0) &&
828 (PathEntry->DirNameLen == 1)) {
846 PathEntry->CdDirName.VersionString.
Length = 0;
852 PathEntry->CdCaseDirName = PathEntry->CdDirName;
867 Length = PathEntry->DirNameLen;
890 (
Length <=
sizeof( PathEntry->NameBuffer ))) {
892 PathEntry->CdDirName.FileName.MaximumLength =
sizeof( PathEntry->NameBuffer );
893 PathEntry->CdDirName.FileName.Buffer = PathEntry->NameBuffer;
902 if (
Length > PathEntry->CdDirName.FileName.MaximumLength) {
910 CdFreePool( &PathEntry->CdDirName.FileName.Buffer );
920 PathEntry->CdDirName.FileName.MaximumLength = (
USHORT)
Length;
932 PathEntry->CdDirName.FileName.MaximumLength,
935 PathEntry->DirNameLen );
949 PathEntry->DirNameLen,
950 (
PCHAR) PathEntry->CdDirName.FileName.Buffer );
952 PathEntry->CdDirName.FileName.Length = (
USHORT) PathEntry->DirNameLen;
959 PathEntry->CdDirName.VersionString.Length =
960 PathEntry->CdCaseDirName.VersionString.Length = 0;
967 if (PathEntry->CdDirName.FileName.Buffer[(PathEntry->CdDirName.FileName.Length -
sizeof(
WCHAR )) / 2] ==
L'.') {
973 PathEntry->CdDirName.FileName.Length -=
sizeof(
WCHAR );
983 PathEntry->CdCaseDirName.FileName.Buffer =
Add2Ptr( PathEntry->CdDirName.FileName.Buffer,
984 PathEntry->CdDirName.FileName.MaximumLength / 2,
987 PathEntry->CdCaseDirName.FileName.MaximumLength = PathEntry->CdDirName.FileName.MaximumLength / 2;
990 &PathEntry->CdDirName,
991 &PathEntry->CdCaseDirName );
995 PathEntry->CdCaseDirName = PathEntry->CdDirName;
#define MIN_RAW_PATH_ENTRY_LEN
#define CdRawPathXar(IC, RP)
#define CdRawPathLoc(IC, RP)
#define CdRawPathIdLen(IC, RP)
UNICODE_STRING CdUnicodeDirectoryNames[]
#define CdUnpinData(IC, B)
#define BlockOffset(V, L)
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PCOMPOUND_PATH_ENTRY CompoundPathEntry
VOID CdConvertBigToLittleEndian(_In_ PIRP_CONTEXT IrpContext, _In_reads_bytes_(ByteCount) PCHAR BigEndian, _In_ ULONG ByteCount, _Out_writes_bytes_(ByteCount) PCHAR LittleEndian)
#define CopyUchar4(Dst, Src)
_In_ PFCB _In_ PCD_NAME DirName
VOID CdUpcaseName(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_NAME Name, _Inout_ PCD_NAME UpcaseName)
BOOLEAN CdIsNameInExpression(_In_ PIRP_CONTEXT IrpContext, _In_ PCD_NAME CurrentName, _In_ PCD_NAME SearchExpression, _In_ ULONG WildcardFlags, _In_ BOOLEAN CheckVersion)
_In_ PFCB _In_ LONGLONG StartingOffset
#define CopyUchar2(Dst, Src)
#define TAG_PATH_ENTRY_NAME
#define SectorTruncate(L)
#define TAG_SPANNING_PATH_TABLE
VOID CdLookupPathEntry(_In_ PIRP_CONTEXT IrpContext, _In_ ULONG PathEntryOffset, _In_ ULONG Ordinal, _In_ BOOLEAN VerifyBounds, _Inout_ PCOMPOUND_PATH_ENTRY CompoundPathEntry)
#define CdUnlockFcb(IC, F)
#define CdRaiseStatus(IC, S)
#define PATH_ENTRY_FLAG_ALLOC_BUFFER
#define VACB_MAPPING_MASK
#define CdQueryFidPathTableOffset(I)
#define LAST_VACB_SECTOR_OFFSET
#define ClearFlag(_F, _SF)
#define Add2Ptr(PTR, INC)
_Use_decl_annotations_ NTSTATUS NTAPI RtlOemToUnicodeN(_Out_ PWCHAR UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH OemString, _In_ ULONG OemSize)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
VOID CdUpdatePathEntryName(_In_ PIRP_CONTEXT IrpContext, _Inout_ PPATH_ENTRY PathEntry, _In_ BOOLEAN IgnoreCase)
BOOLEAN CdLookupNextPathEntry(_In_ PIRP_CONTEXT IrpContext, _Inout_ PPATH_ENUM_CONTEXT PathContext, _Inout_ PPATH_ENTRY PathEntry)
VOID CdMapPathTableBlock(_In_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb, _In_ LONGLONG BaseOffset, _Inout_ PPATH_ENUM_CONTEXT PathContext)
#define CdRawPathEntry(IC, PC)
BOOLEAN NTAPI CcMapData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *BcbResult, OUT PVOID *Buffer)
#define __analysis_assert(e)
UCHAR DirId[MAX_FILE_ID_LENGTH]
struct _FCB * RootIndexFcb
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_DISK_CORRUPT_ERROR