Author: tfaber Date: Mon Nov 30 11:25:14 2015 New Revision: 70216
URL: http://svn.reactos.org/svn/reactos?rev=70216&view=rev Log: [FASTFAT] - Gracefully handle empty filenames found on disk, and warn about them.
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/fcb.c
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Mon Nov 30 11:25:14 2015 @@ -288,6 +288,18 @@ 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) ||
Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Mon Nov 30 11:25:14 2015 @@ -759,6 +759,18 @@
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) {