mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[FASTFAT]
In the FCB, get rid of the FCB_IS_FATX_ENTRY flag. It makes no sense to have it on each and every file as the VCB already has such flag svn path=/trunk/; revision=73821
This commit is contained in:
parent
36bd380f3a
commit
41f23cace3
11 changed files with 61 additions and 55 deletions
|
@ -78,14 +78,14 @@ VfatCleanupFile(
|
|||
|
||||
if (BooleanFlagOn(pFcb->Flags, FCB_IS_DIRTY))
|
||||
{
|
||||
VfatUpdateEntry (pFcb);
|
||||
VfatUpdateEntry (pFcb, vfatVolumeIsFatX(DeviceExt));
|
||||
}
|
||||
|
||||
if (BooleanFlagOn(pFcb->Flags, FCB_DELETE_PENDING) &&
|
||||
pFcb->OpenHandleCount == 0)
|
||||
{
|
||||
if (vfatFCBIsDirectory(pFcb) &&
|
||||
!VfatIsDirectoryEmpty(pFcb))
|
||||
!VfatIsDirectoryEmpty(pFcb, vfatVolumeIsFatX(DeviceExt)))
|
||||
{
|
||||
pFcb->Flags &= ~FCB_DELETE_PENDING;
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ ReadVolumeLabel(
|
|||
*(Vpb->VolumeLabel) = 0;
|
||||
Vpb->VolumeLabelLength = 0;
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
SizeDirEntry = sizeof(FATX_DIR_ENTRY);
|
||||
EntriesPerPage = FATX_ENTRIES_PER_PAGE;
|
||||
|
@ -151,7 +151,7 @@ ReadVolumeLabel(
|
|||
if (ENTRY_VOLUME(DeviceExt, Entry))
|
||||
{
|
||||
/* copy volume label */
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
StringO.Buffer = (PCHAR)Entry->FatX.Filename;
|
||||
StringO.MaximumLength = StringO.Length = Entry->FatX.FilenameLength;
|
||||
|
@ -259,7 +259,7 @@ FindFile(
|
|||
if (rcFcb)
|
||||
{
|
||||
ULONG startIndex = rcFcb->startIndex;
|
||||
if (BooleanFlagOn(rcFcb->Flags, FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot(Parent))
|
||||
if (vfatVolumeIsFatX(DeviceExt) && !vfatFCBIsRoot(Parent))
|
||||
{
|
||||
startIndex += 2;
|
||||
}
|
||||
|
@ -947,7 +947,7 @@ VfatCreateFile(
|
|||
{
|
||||
*pFcb->Attributes = Stack->Parameters.Create.FileAttributes & ~FILE_ATTRIBUTE_NORMAL;
|
||||
*pFcb->Attributes |= FILE_ATTRIBUTE_ARCHIVE;
|
||||
VfatUpdateEntry(pFcb);
|
||||
VfatUpdateEntry(pFcb, vfatVolumeIsFatX(DeviceExt));
|
||||
}
|
||||
|
||||
ExAcquireResourceExclusiveLite(&(pFcb->MainResource), TRUE);
|
||||
|
|
|
@ -127,7 +127,7 @@ VfatGetFileDirectoryInformation(
|
|||
DirContext->LongNameU.Buffer,
|
||||
DirContext->LongNameU.Length);
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
FsdDosDateTimeToSystemTime(DeviceExt,
|
||||
DirContext->DirEntry.FatX.CreationDate,
|
||||
|
@ -220,7 +220,7 @@ VfatGetFileFullDirectoryInformation(
|
|||
DirContext->LongNameU.Buffer,
|
||||
DirContext->LongNameU.Length);
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
FsdDosDateTimeToSystemTime(DeviceExt,
|
||||
DirContext->DirEntry.FatX.CreationDate,
|
||||
|
@ -285,7 +285,7 @@ VfatGetFileBothInformation(
|
|||
|
||||
pInfo->EaSize = 0;
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
pInfo->FileNameLength = DirContext->LongNameU.Length;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ vfatDirEntryGetFirstCluster(
|
|||
cluster = pFatDirEntry->Fat.FirstCluster |
|
||||
(pFatDirEntry->Fat.FirstClusterHigh << 16);
|
||||
}
|
||||
else if (BooleanFlagOn(pDeviceExt->Flags, VCB_IS_FATX))
|
||||
else if (vfatVolumeIsFatX(pDeviceExt))
|
||||
{
|
||||
cluster = pFatDirEntry->FatX.FirstCluster;
|
||||
}
|
||||
|
@ -170,9 +170,10 @@ FATXIsDirectoryEmpty(
|
|||
|
||||
BOOLEAN
|
||||
VfatIsDirectoryEmpty(
|
||||
PVFATFCB Fcb)
|
||||
PVFATFCB Fcb,
|
||||
BOOLEAN IsFatX)
|
||||
{
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (IsFatX)
|
||||
return FATXIsDirectoryEmpty(Fcb);
|
||||
else
|
||||
return FATIsDirectoryEmpty(Fcb);
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
*/
|
||||
NTSTATUS
|
||||
VfatUpdateEntry(
|
||||
IN PVFATFCB pFcb)
|
||||
IN PVFATFCB pFcb,
|
||||
IN BOOLEAN IsFatX)
|
||||
{
|
||||
PVOID Context;
|
||||
PDIR_ENTRY PinEntry;
|
||||
|
@ -31,7 +32,7 @@ VfatUpdateEntry(
|
|||
|
||||
ASSERT(pFcb);
|
||||
|
||||
if (BooleanFlagOn(pFcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (IsFatX)
|
||||
{
|
||||
SizeDirEntry = sizeof(FATX_DIR_ENTRY);
|
||||
dirIndex = pFcb->startIndex;
|
||||
|
@ -90,7 +91,7 @@ vfatRenameEntry(
|
|||
|
||||
DPRINT("vfatRenameEntry(%p, %p, %wZ, %d)\n", DeviceExt, pFcb, FileName, CaseChangeOnly);
|
||||
|
||||
if (BooleanFlagOn(pFcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
VFAT_DIRENTRY_CONTEXT DirContext;
|
||||
|
||||
|
@ -162,7 +163,7 @@ vfatFindDirSpace(
|
|||
ULONG SizeDirEntry;
|
||||
FileOffset.QuadPart = 0;
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
SizeDirEntry = sizeof(FATX_DIR_ENTRY);
|
||||
else
|
||||
SizeDirEntry = sizeof(FAT_DIR_ENTRY);
|
||||
|
@ -248,7 +249,7 @@ vfatFindDirSpace(
|
|||
}
|
||||
_SEH2_END;
|
||||
|
||||
if (DeviceExt->Flags & VCB_IS_FATX)
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
memset(pFatEntry, 0xff, DeviceExt->FatInfo.BytesPerCluster);
|
||||
else
|
||||
RtlZeroMemory(pFatEntry, DeviceExt->FatInfo.BytesPerCluster);
|
||||
|
@ -267,7 +268,7 @@ vfatFindDirSpace(
|
|||
}
|
||||
_SEH2_END;
|
||||
|
||||
if (DeviceExt->Flags & VCB_IS_FATX)
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
memset(pFatEntry, 0xff, SizeDirEntry);
|
||||
else
|
||||
RtlZeroMemory(pFatEntry, SizeDirEntry);
|
||||
|
@ -824,7 +825,7 @@ VfatAddEntry(
|
|||
IN UCHAR ReqAttr,
|
||||
IN PVFAT_MOVE_CONTEXT MoveContext)
|
||||
{
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
return FATXAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr, MoveContext);
|
||||
else
|
||||
return FATAddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr, MoveContext);
|
||||
|
@ -927,7 +928,7 @@ FATXDelEntry(
|
|||
|
||||
ASSERT(pFcb);
|
||||
ASSERT(pFcb->parentFcb);
|
||||
ASSERT(BooleanFlagOn(pFcb->Flags, FCB_IS_FATX_ENTRY));
|
||||
ASSERT(vfatVolumeIsFatX(DeviceExt));
|
||||
|
||||
StartIndex = pFcb->startIndex;
|
||||
|
||||
|
@ -983,7 +984,7 @@ VfatDelEntry(
|
|||
IN PVFATFCB pFcb,
|
||||
OUT PVFAT_MOVE_CONTEXT MoveContext)
|
||||
{
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
return FATXDelEntry(DeviceExt, pFcb, MoveContext);
|
||||
else
|
||||
return FATDelEntry(DeviceExt, pFcb, MoveContext);
|
||||
|
|
|
@ -136,11 +136,8 @@ vfatNewFCB(
|
|||
}
|
||||
RtlZeroMemory(rcFCB, sizeof(VFATFCB));
|
||||
vfatInitFcb(rcFCB, pFileNameU);
|
||||
if (BooleanFlagOn(pVCB->Flags, VCB_IS_FATX))
|
||||
{
|
||||
rcFCB->Flags |= FCB_IS_FATX_ENTRY;
|
||||
if (vfatVolumeIsFatX(pVCB))
|
||||
rcFCB->Attributes = &rcFCB->entry.FatX.Attrib;
|
||||
}
|
||||
else
|
||||
rcFCB->Attributes = &rcFCB->entry.Fat.Attrib;
|
||||
rcFCB->Hash.Hash = vfatNameHash(0, &rcFCB->PathNameU);
|
||||
|
@ -371,7 +368,7 @@ vfatInitFCBFromDirEntry(
|
|||
RtlCopyMemory(&Fcb->entry, &DirContext->DirEntry, sizeof (DIR_ENTRY));
|
||||
RtlCopyUnicodeString(&Fcb->ShortNameU, &DirContext->ShortNameU);
|
||||
Fcb->Hash.Hash = vfatNameHash(0, &Fcb->PathNameU);
|
||||
if (Vcb->Flags & VCB_IS_FATX)
|
||||
if (vfatVolumeIsFatX(Vcb))
|
||||
{
|
||||
Fcb->ShortHash.Hash = Fcb->Hash.Hash;
|
||||
}
|
||||
|
@ -401,7 +398,7 @@ vfatInitFCBFromDirEntry(
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
else if (vfatVolumeIsFatX(Vcb))
|
||||
{
|
||||
Size = Fcb->entry.FatX.FileSize;
|
||||
}
|
||||
|
@ -411,7 +408,7 @@ vfatInitFCBFromDirEntry(
|
|||
}
|
||||
Fcb->dirIndex = DirContext->DirIndex;
|
||||
Fcb->startIndex = DirContext->StartIndex;
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot(Fcb))
|
||||
if (vfatVolumeIsFatX(Vcb) && !vfatFCBIsRoot(Fcb))
|
||||
{
|
||||
ASSERT(DirContext->DirIndex >= 2 && DirContext->StartIndex >= 2);
|
||||
Fcb->dirIndex = DirContext->DirIndex-2;
|
||||
|
@ -453,7 +450,7 @@ vfatSetFCBNewDirName(
|
|||
Fcb->DirNameU.Buffer = Fcb->PathNameU.Buffer;
|
||||
vfatSplitPathName(&Fcb->PathNameU, &Fcb->DirNameU, &Fcb->LongNameU);
|
||||
Fcb->Hash.Hash = vfatNameHash(0, &Fcb->PathNameU);
|
||||
if (BooleanFlagOn(pVCB->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(pVCB))
|
||||
{
|
||||
Fcb->ShortHash.Hash = Fcb->Hash.Hash;
|
||||
}
|
||||
|
@ -637,7 +634,7 @@ vfatMakeRootFCB(
|
|||
UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\");
|
||||
|
||||
FCB = vfatNewFCB(pVCB, &NameU);
|
||||
if (BooleanFlagOn(FCB->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(pVCB))
|
||||
{
|
||||
memset(FCB->entry.FatX.Filename, ' ', 42);
|
||||
FCB->entry.FatX.FileSize = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector;
|
||||
|
|
|
@ -165,7 +165,7 @@ VfatSetBasicInformation(
|
|||
/* Check volume label bit */
|
||||
ASSERT(0 == (*FCB->Attributes & _A_VOLID));
|
||||
|
||||
if (BooleanFlagOn(FCB->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
if (BasicInfo->CreationTime.QuadPart != 0 && BasicInfo->CreationTime.QuadPart != -1)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ VfatSetBasicInformation(
|
|||
DPRINT("Setting attributes 0x%02x\n", *FCB->Attributes);
|
||||
}
|
||||
|
||||
VfatUpdateEntry(FCB);
|
||||
VfatUpdateEntry(FCB, vfatVolumeIsFatX(DeviceExt));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ VfatGetBasicInformation(
|
|||
if (*BufferLength < sizeof(FILE_BASIC_INFORMATION))
|
||||
return STATUS_BUFFER_OVERFLOW;
|
||||
|
||||
if (BooleanFlagOn(FCB->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
FsdDosDateTimeToSystemTime(DeviceExt,
|
||||
FCB->entry.FatX.CreationDate,
|
||||
|
@ -313,9 +313,7 @@ VfatSetDispositionInformation(
|
|||
PDEVICE_OBJECT DeviceObject,
|
||||
PFILE_DISPOSITION_INFORMATION DispositionInfo)
|
||||
{
|
||||
#if DBG
|
||||
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
|
||||
#endif
|
||||
|
||||
DPRINT("FsdSetDispositionInformation(<%wZ>, Delete %u)\n", &FCB->PathNameU, DispositionInfo->DeleteFile);
|
||||
|
||||
|
@ -359,7 +357,7 @@ VfatSetDispositionInformation(
|
|||
return STATUS_CANNOT_DELETE;
|
||||
}
|
||||
|
||||
if (vfatFCBIsDirectory(FCB) && !VfatIsDirectoryEmpty(FCB))
|
||||
if (vfatFCBIsDirectory(FCB) && !VfatIsDirectoryEmpty(FCB, vfatVolumeIsFatX(DeviceExt)))
|
||||
{
|
||||
/* can't delete a non-empty directory */
|
||||
|
||||
|
@ -1043,7 +1041,7 @@ VfatGetNetworkOpenInformation(
|
|||
if (*BufferLength < sizeof(FILE_NETWORK_OPEN_INFORMATION))
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
FsdDosDateTimeToSystemTime(DeviceExt,
|
||||
Fcb->entry.FatX.CreationDate,
|
||||
|
@ -1184,7 +1182,8 @@ UpdateFileSize(
|
|||
PFILE_OBJECT FileObject,
|
||||
PVFATFCB Fcb,
|
||||
ULONG Size,
|
||||
ULONG ClusterSize)
|
||||
ULONG ClusterSize,
|
||||
BOOLEAN IsFatX)
|
||||
{
|
||||
if (Size > 0)
|
||||
{
|
||||
|
@ -1196,7 +1195,7 @@ UpdateFileSize(
|
|||
}
|
||||
if (!vfatFCBIsDirectory(Fcb))
|
||||
{
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (IsFatX)
|
||||
Fcb->entry.FatX.FileSize = Size;
|
||||
else
|
||||
Fcb->entry.Fat.FileSize = Size;
|
||||
|
@ -1221,7 +1220,7 @@ VfatSetAllocationSizeInformation(
|
|||
ULONG ClusterSize = DeviceExt->FatInfo.BytesPerCluster;
|
||||
ULONG NewSize = AllocationSize->u.LowPart;
|
||||
ULONG NCluster;
|
||||
BOOLEAN AllocSizeChanged = FALSE, IsFatX = BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY);
|
||||
BOOLEAN AllocSizeChanged = FALSE, IsFatX = vfatVolumeIsFatX(DeviceExt);
|
||||
|
||||
DPRINT("VfatSetAllocationSizeInformation(File <%wZ>, AllocationSize %d %u)\n",
|
||||
&Fcb->PathNameU, AllocationSize->HighPart, AllocationSize->LowPart);
|
||||
|
@ -1348,7 +1347,7 @@ VfatSetAllocationSizeInformation(
|
|||
return STATUS_DISK_FULL;
|
||||
}
|
||||
}
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize);
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize, vfatVolumeIsFatX(DeviceExt));
|
||||
}
|
||||
else if (NewSize + ClusterSize <= Fcb->RFCB.AllocationSize.u.LowPart)
|
||||
{
|
||||
|
@ -1364,7 +1363,7 @@ VfatSetAllocationSizeInformation(
|
|||
AllocSizeChanged = TRUE;
|
||||
/* FIXME: Use the cached cluster/offset better way. */
|
||||
Fcb->LastCluster = Fcb->LastOffset = 0;
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize);
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize, vfatVolumeIsFatX(DeviceExt));
|
||||
if (NewSize > 0)
|
||||
{
|
||||
Status = OffsetToCluster(DeviceExt, FirstCluster,
|
||||
|
@ -1408,14 +1407,14 @@ VfatSetAllocationSizeInformation(
|
|||
}
|
||||
else
|
||||
{
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize);
|
||||
UpdateFileSize(FileObject, Fcb, NewSize, ClusterSize, vfatVolumeIsFatX(DeviceExt));
|
||||
}
|
||||
|
||||
/* Update the on-disk directory entry */
|
||||
Fcb->Flags |= FCB_IS_DIRTY;
|
||||
if (AllocSizeChanged)
|
||||
{
|
||||
VfatUpdateEntry(Fcb);
|
||||
VfatUpdateEntry(Fcb, vfatVolumeIsFatX(DeviceExt));
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ VfatFlushFile(
|
|||
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_DIRTY))
|
||||
{
|
||||
Status = VfatUpdateEntry(Fcb);
|
||||
Status = VfatUpdateEntry(Fcb, vfatVolumeIsFatX(DeviceExt));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
IoStatus.Status = Status;
|
||||
|
|
|
@ -1017,7 +1017,7 @@ Metadata:
|
|||
|
||||
// set dates and times
|
||||
KeQuerySystemTime (&SystemTime);
|
||||
if (BooleanFlagOn(Fcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(IrpContext->DeviceExt))
|
||||
{
|
||||
FsdSystemTimeToDosDateTime(IrpContext->DeviceExt,
|
||||
&SystemTime, &Fcb->entry.FatX.UpdateDate,
|
||||
|
|
|
@ -197,9 +197,9 @@ typedef struct _slot slot;
|
|||
|
||||
#define LONGNAME_MAX_LENGTH 256 // max length for a long filename
|
||||
|
||||
#define ENTRY_DELETED(DeviceExt, DirEntry) (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX) ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
|
||||
#define ENTRY_VOLUME(DeviceExt, DirEntry) (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX) ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
|
||||
#define ENTRY_END(DeviceExt, DirEntry) (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX) ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
|
||||
#define ENTRY_DELETED(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
|
||||
#define ENTRY_VOLUME(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
|
||||
#define ENTRY_END(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
|
||||
|
||||
#define FAT_ENTRY_DELETED(DirEntry) ((DirEntry)->Filename[0] == 0xe5)
|
||||
#define FAT_ENTRY_END(DirEntry) ((DirEntry)->Filename[0] == 0)
|
||||
|
@ -346,7 +346,6 @@ extern PVFAT_GLOBAL_DATA VfatGlobalData;
|
|||
#define FCB_IS_PAGE_FILE 0x0008
|
||||
#define FCB_IS_VOLUME 0x0010
|
||||
#define FCB_IS_DIRTY 0x0020
|
||||
#define FCB_IS_FATX_ENTRY 0x0040
|
||||
|
||||
typedef struct _VFATFCB
|
||||
{
|
||||
|
@ -530,6 +529,13 @@ vfatFCBIsReadOnly(PVFATFCB FCB)
|
|||
return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_READONLY);
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
|
||||
{
|
||||
return BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX);
|
||||
}
|
||||
|
||||
/* blockdev.c */
|
||||
|
||||
NTSTATUS
|
||||
|
@ -636,7 +642,8 @@ vfatDirEntryGetFirstCluster(
|
|||
|
||||
BOOLEAN
|
||||
VfatIsDirectoryEmpty(
|
||||
PVFATFCB Fcb);
|
||||
PVFATFCB Fcb,
|
||||
BOOLEAN IsFatX);
|
||||
|
||||
NTSTATUS
|
||||
FATGetNextDirEntry(
|
||||
|
@ -668,7 +675,8 @@ VfatAddEntry(
|
|||
|
||||
NTSTATUS
|
||||
VfatUpdateEntry(
|
||||
PVFATFCB pFcb);
|
||||
PVFATFCB pFcb,
|
||||
IN BOOLEAN IsFatX);
|
||||
|
||||
NTSTATUS
|
||||
VfatDelEntry(
|
||||
|
|
|
@ -59,7 +59,7 @@ FsdGetFsVolumeInformation(
|
|||
*BufferLength -= DeviceObject->Vpb->VolumeLabelLength;
|
||||
}
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->VolumeFcb->Flags, FCB_IS_FATX_ENTRY))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
FsdDosDateTimeToSystemTime(DeviceExt,
|
||||
DeviceExt->VolumeFcb->entry.FatX.CreationDate,
|
||||
|
@ -260,7 +260,7 @@ FsdSetFsLabelInformation(
|
|||
return STATUS_NAME_TOO_LONG;
|
||||
}
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 42)
|
||||
return STATUS_NAME_TOO_LONG;
|
||||
|
@ -289,7 +289,7 @@ FsdSetFsLabelInformation(
|
|||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
if (BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX))
|
||||
if (vfatVolumeIsFatX(DeviceExt))
|
||||
{
|
||||
RtlCopyMemory(VolumeLabelDirEntry.FatX.Filename, cString, LabelLen);
|
||||
memset(&VolumeLabelDirEntry.FatX.Filename[LabelLen], ' ', 42 - LabelLen);
|
||||
|
|
Loading…
Reference in a new issue