mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 04:14:53 +00:00
[VFATFS] Correctly init dirIndex/startIndex on FATX subdirectories
'.' and '..' entries do not exist on FATX subdirectories. We have to fake them when enumerating the directory, and ignore them when creating a FCB from a directory entry. CORE-16373
This commit is contained in:
parent
0979fb29e2
commit
fa809fd2fe
1 changed files with 5 additions and 5 deletions
|
@ -428,6 +428,7 @@ static
|
||||||
VOID
|
VOID
|
||||||
vfatInitFCBFromDirEntry(
|
vfatInitFCBFromDirEntry(
|
||||||
PDEVICE_EXTENSION Vcb,
|
PDEVICE_EXTENSION Vcb,
|
||||||
|
PVFATFCB ParentFcb,
|
||||||
PVFATFCB Fcb,
|
PVFATFCB Fcb,
|
||||||
PVFAT_DIRENTRY_CONTEXT DirContext)
|
PVFAT_DIRENTRY_CONTEXT DirContext)
|
||||||
{
|
{
|
||||||
|
@ -476,7 +477,8 @@ vfatInitFCBFromDirEntry(
|
||||||
}
|
}
|
||||||
Fcb->dirIndex = DirContext->DirIndex;
|
Fcb->dirIndex = DirContext->DirIndex;
|
||||||
Fcb->startIndex = DirContext->StartIndex;
|
Fcb->startIndex = DirContext->StartIndex;
|
||||||
if (vfatVolumeIsFatX(Vcb) && !vfatFCBIsRoot(Fcb))
|
Fcb->parentFcb = ParentFcb;
|
||||||
|
if (vfatVolumeIsFatX(Vcb) && !vfatFCBIsRoot(ParentFcb))
|
||||||
{
|
{
|
||||||
ASSERT(DirContext->DirIndex >= 2 && DirContext->StartIndex >= 2);
|
ASSERT(DirContext->DirIndex >= 2 && DirContext->StartIndex >= 2);
|
||||||
Fcb->dirIndex = DirContext->DirIndex-2;
|
Fcb->dirIndex = DirContext->DirIndex-2;
|
||||||
|
@ -572,13 +574,12 @@ vfatUpdateFCB(
|
||||||
RemoveEntryList(&Fcb->ParentListEntry);
|
RemoveEntryList(&Fcb->ParentListEntry);
|
||||||
|
|
||||||
/* Reinit FCB */
|
/* Reinit FCB */
|
||||||
vfatInitFCBFromDirEntry(pVCB, Fcb, DirContext);
|
vfatInitFCBFromDirEntry(pVCB, ParentFcb, Fcb, DirContext);
|
||||||
|
|
||||||
if (vfatFCBIsDirectory(Fcb))
|
if (vfatFCBIsDirectory(Fcb))
|
||||||
{
|
{
|
||||||
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
|
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
Fcb->parentFcb = ParentFcb;
|
|
||||||
InsertTailList(&ParentFcb->ParentListHead, &Fcb->ParentListEntry);
|
InsertTailList(&ParentFcb->ParentListHead, &Fcb->ParentListEntry);
|
||||||
vfatAddFCBToTable(pVCB, Fcb);
|
vfatAddFCBToTable(pVCB, Fcb);
|
||||||
|
|
||||||
|
@ -739,10 +740,9 @@ vfatMakeFCBFromDirEntry(
|
||||||
}
|
}
|
||||||
|
|
||||||
rcFCB = vfatNewFCB(vcb, &NameU);
|
rcFCB = vfatNewFCB(vcb, &NameU);
|
||||||
vfatInitFCBFromDirEntry(vcb, rcFCB, DirContext);
|
vfatInitFCBFromDirEntry(vcb, directoryFCB, rcFCB, DirContext);
|
||||||
|
|
||||||
rcFCB->RefCount = 1;
|
rcFCB->RefCount = 1;
|
||||||
rcFCB->parentFcb = directoryFCB;
|
|
||||||
InsertTailList(&directoryFCB->ParentListHead, &rcFCB->ParentListEntry);
|
InsertTailList(&directoryFCB->ParentListHead, &rcFCB->ParentListEntry);
|
||||||
vfatAddFCBToTable(vcb, rcFCB);
|
vfatAddFCBToTable(vcb, rcFCB);
|
||||||
*fileFCB = rcFCB;
|
*fileFCB = rcFCB;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue