mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:22:57 +00:00
[FASTFAT]
Don't allow renaming a directory if there are opened files in it. The way we do it for now isn't fully optimal and could be really improved, but that's a first step in the right direction. This should help getting rid of FAT volumes corruption. This also fixes a few winetests it seems. CORE-11426 #comment Patch that fixes bug 3 committed in r71674 svn path=/trunk/; revision=71674
This commit is contained in:
parent
d19532d463
commit
1edb644ad2
1 changed files with 21 additions and 0 deletions
|
@ -704,6 +704,27 @@ VfatSetRenameInformation(
|
||||||
vfatSplitPathName(&NewName, &NewPath, &NewFile);
|
vfatSplitPathName(&NewName, &NewPath, &NewFile);
|
||||||
DPRINT("New dir: %wZ, New file: %wZ\n", &NewPath, &NewFile);
|
DPRINT("New dir: %wZ, New file: %wZ\n", &NewPath, &NewFile);
|
||||||
|
|
||||||
|
/* FIXME: Do it in a more efficient way, like linking FCBs to their parent FCB so that we browse less FCBs
|
||||||
|
* Note: The FIXME is the way MS FastFAT seems to do it
|
||||||
|
*/
|
||||||
|
if (vfatFCBIsDirectory(FCB))
|
||||||
|
{
|
||||||
|
PLIST_ENTRY Entry;
|
||||||
|
PVFATFCB VolFCB;
|
||||||
|
|
||||||
|
for (Entry = DeviceExt->FcbListHead.Flink; Entry != &DeviceExt->FcbListHead; Entry = Entry->Flink)
|
||||||
|
{
|
||||||
|
VolFCB = CONTAINING_RECORD(Entry, VFATFCB, FcbListEntry);
|
||||||
|
if (VolFCB->parentFcb == FCB && VolFCB->OpenHandleCount != 0)
|
||||||
|
{
|
||||||
|
DPRINT1("At least one children file opened! %wZ (%u, %u)\n", &VolFCB->PathNameU, VolFCB->RefCount, VolFCB->OpenHandleCount);
|
||||||
|
Status = STATUS_ACCESS_DENIED;
|
||||||
|
ASSERT(OldReferences == FCB->parentFcb->RefCount);
|
||||||
|
goto Cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Are we working in place? */
|
/* Are we working in place? */
|
||||||
if (FsRtlAreNamesEqual(&SourcePath, &NewPath, TRUE, NULL))
|
if (FsRtlAreNamesEqual(&SourcePath, &NewPath, TRUE, NULL))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue