diff options
Diffstat (limited to 'filesys')
| -rw-r--r-- | filesys/fastfat/fsctrl.c | 44 | ||||
| -rw-r--r-- | filesys/fastfat/volinfo.c | 9 |
2 files changed, 43 insertions, 10 deletions
diff --git a/filesys/fastfat/fsctrl.c b/filesys/fastfat/fsctrl.c index d6bf369b..7371c7fd 100644 --- a/filesys/fastfat/fsctrl.c +++ b/filesys/fastfat/fsctrl.c @@ -1411,22 +1411,34 @@ Return Value: if (Dirent != NULL) { + UCHAR OemBuffer[11]; OEM_STRING OemString; UNICODE_STRING UnicodeString; + OemString.Buffer = (PCHAR)&OemBuffer[0]; + OemString.MaximumLength = 11; + + RtlCopyMemory( OemString.Buffer, Dirent->FileName, 11 ); + // - // Compute the length of the volume name + // Translate the first character from 0x5 to 0xe5. // - OemString.Buffer = (PCHAR)&Dirent->FileName[0]; - OemString.MaximumLength = 11; + if (OemString.Buffer[0] == FAT_DIRENT_REALLY_0E5) { + + OemString.Buffer[0] = 0xe5; + } + + // + // Compute the length of the volume name + // for ( OemString.Length = 11; OemString.Length > 0; OemString.Length -= 1) { - if ( (Dirent->FileName[OemString.Length-1] != 0x00) && - (Dirent->FileName[OemString.Length-1] != 0x20) ) { break; } + if ( (OemString.Buffer[OemString.Length-1] != 0x00) && + (OemString.Buffer[OemString.Length-1] != 0x20) ) { break; } } UnicodeString.MaximumLength = MAXIMUM_VOLUME_LABEL_LENGTH; @@ -7794,6 +7806,7 @@ Return Value: PDIRENT Dirent; PDIRENT TerminationDirent; ULONG VolumeLabelLength; + UCHAR OemBuffer[11]; OEM_STRING OemString; UNICODE_STRING UnicodeString; @@ -7840,19 +7853,30 @@ Return Value: } + OemString.Buffer = (PCHAR)&OemBuffer[0]; + OemString.MaximumLength = 11; + + RtlCopyMemory( OemString.Buffer, Dirent->FileName, 11 ); + // - // Compute the length of the volume name + // Translate the first character from 0x5 to 0xe5. // - OemString.Buffer = (PCHAR)&Dirent->FileName[0]; - OemString.MaximumLength = 11; + if (OemString.Buffer[0] == FAT_DIRENT_REALLY_0E5) { + + OemString.Buffer[0] = 0xe5; + } + + // + // Compute the length of the volume name + // for ( OemString.Length = 11; OemString.Length > 0; OemString.Length -= 1) { - if ( (Dirent->FileName[OemString.Length-1] != 0x00) && - (Dirent->FileName[OemString.Length-1] != 0x20) ) { break; } + if ( (OemString.Buffer[OemString.Length-1] != 0x00) && + (OemString.Buffer[OemString.Length-1] != 0x20) ) { break; } } UnicodeString.MaximumLength = sizeof( UnicodeBuffer ); diff --git a/filesys/fastfat/volinfo.c b/filesys/fastfat/volinfo.c index 9827ca4b..8bed20dd 100644 --- a/filesys/fastfat/volinfo.c +++ b/filesys/fastfat/volinfo.c @@ -1154,6 +1154,15 @@ Return Value: if (OemLabel.Length > 0) { // + // Translate the first character from 0xe5 to 0x5. + // + + if ((UCHAR)OemLabel.Buffer[0] == 0xe5) { + + OemLabel.Buffer[0] = FAT_DIRENT_REALLY_0E5; + } + + // // Locate the volume label if there already is one // |
