mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[VFATFS] Always provide a short name for FATX files (equal to long name)
If no short name is provided, driver will think that the partition is corrupted. CORE-16373
This commit is contained in:
parent
b935bfe6cb
commit
0979fb29e2
1 changed files with 3 additions and 6 deletions
|
@ -497,10 +497,9 @@ FATXGetNextDirEntry(
|
||||||
switch (DirContext->DirIndex)
|
switch (DirContext->DirIndex)
|
||||||
{
|
{
|
||||||
case 0: /* entry . */
|
case 0: /* entry . */
|
||||||
DirContext->ShortNameU.Buffer[0] = 0;
|
|
||||||
DirContext->ShortNameU.Length = 0;
|
|
||||||
wcscpy(DirContext->LongNameU.Buffer, L".");
|
wcscpy(DirContext->LongNameU.Buffer, L".");
|
||||||
DirContext->LongNameU.Length = sizeof(WCHAR);
|
DirContext->LongNameU.Length = sizeof(WCHAR);
|
||||||
|
DirContext->ShortNameU = DirContext->LongNameU;
|
||||||
RtlCopyMemory(&DirContext->DirEntry.FatX, &pDirFcb->entry.FatX, sizeof(FATX_DIR_ENTRY));
|
RtlCopyMemory(&DirContext->DirEntry.FatX, &pDirFcb->entry.FatX, sizeof(FATX_DIR_ENTRY));
|
||||||
DirContext->DirEntry.FatX.Filename[0] = '.';
|
DirContext->DirEntry.FatX.Filename[0] = '.';
|
||||||
DirContext->DirEntry.FatX.FilenameLength = 1;
|
DirContext->DirEntry.FatX.FilenameLength = 1;
|
||||||
|
@ -508,10 +507,9 @@ FATXGetNextDirEntry(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
case 1: /* entry .. */
|
case 1: /* entry .. */
|
||||||
DirContext->ShortNameU.Buffer[0] = 0;
|
|
||||||
DirContext->ShortNameU.Length = 0;
|
|
||||||
wcscpy(DirContext->LongNameU.Buffer, L"..");
|
wcscpy(DirContext->LongNameU.Buffer, L"..");
|
||||||
DirContext->LongNameU.Length = 2 * sizeof(WCHAR);
|
DirContext->LongNameU.Length = 2 * sizeof(WCHAR);
|
||||||
|
DirContext->ShortNameU = DirContext->LongNameU;
|
||||||
RtlCopyMemory(&DirContext->DirEntry.FatX, &pDirFcb->entry.FatX, sizeof(FATX_DIR_ENTRY));
|
RtlCopyMemory(&DirContext->DirEntry.FatX, &pDirFcb->entry.FatX, sizeof(FATX_DIR_ENTRY));
|
||||||
DirContext->DirEntry.FatX.Filename[0] = DirContext->DirEntry.FatX.Filename[1] = '.';
|
DirContext->DirEntry.FatX.Filename[0] = DirContext->DirEntry.FatX.Filename[1] = '.';
|
||||||
DirContext->DirEntry.FatX.FilenameLength = 2;
|
DirContext->DirEntry.FatX.FilenameLength = 2;
|
||||||
|
@ -603,10 +601,9 @@ FATXGetNextDirEntry(
|
||||||
fatxDirEntry++;
|
fatxDirEntry++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DirContext->ShortNameU.Buffer[0] = 0;
|
|
||||||
DirContext->ShortNameU.Length = 0;
|
|
||||||
StringO.Buffer = (PCHAR)fatxDirEntry->Filename;
|
StringO.Buffer = (PCHAR)fatxDirEntry->Filename;
|
||||||
StringO.Length = StringO.MaximumLength = fatxDirEntry->FilenameLength;
|
StringO.Length = StringO.MaximumLength = fatxDirEntry->FilenameLength;
|
||||||
RtlOemStringToUnicodeString(&DirContext->LongNameU, &StringO, FALSE);
|
RtlOemStringToUnicodeString(&DirContext->LongNameU, &StringO, FALSE);
|
||||||
|
DirContext->ShortNameU = DirContext->LongNameU;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue