[FASTFAT]

- Gracefully handle empty filenames found on disk, and warn about them.

svn path=/trunk/; revision=70216
This commit is contained in:
Thomas Faber 2015-11-30 11:25:14 +00:00
parent e828ff57bc
commit 95fa8202a5
2 changed files with 24 additions and 0 deletions

View file

@ -288,6 +288,18 @@ FindFile(
DirContext->DirIndex++;
continue;
}
if (DirContext->LongNameU.Length == 0 ||
DirContext->ShortNameU.Length == 0)
{
DPRINT1("WARNING: File system corruption detected. You may need to run a disk repair utility.\n");
if (VfatGlobalData->Flags & VFAT_BREAK_ON_CORRUPTION)
{
ASSERT(DirContext->LongNameU.Length != 0 &&
DirContext->ShortNameU.Length != 0);
}
DirContext->DirIndex++;
continue;
}
if (WildCard)
{
Found = FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->LongNameU, TRUE, NULL) ||

View file

@ -759,6 +759,18 @@ vfatDirFindFile(
if (!ENTRY_VOLUME(pDeviceExt, &DirContext.DirEntry))
{
if (DirContext.LongNameU.Length == 0 ||
DirContext.ShortNameU.Length == 0)
{
DPRINT1("WARNING: File system corruption detected. You may need to run a disk repair utility.\n");
if (VfatGlobalData->Flags & VFAT_BREAK_ON_CORRUPTION)
{
ASSERT(DirContext.LongNameU.Length != 0 &&
DirContext.ShortNameU.Length != 0);
}
DirContext.DirIndex++;
continue;
}
FoundLong = RtlEqualUnicodeString(FileToFindU, &DirContext.LongNameU, TRUE);
if (FoundLong == FALSE)
{