sys: FspFsvolQueryFsAttributeInformation: allow file system to fully specify file system name

tst: memfs: add -F FileSystemName option
This commit is contained in:
Bill Zissimopoulos
2016-12-15 14:26:36 -08:00
parent b55c20b393
commit 1e03c1a465
4 changed files with 26 additions and 9 deletions

View File

@ -98,16 +98,22 @@ static NTSTATUS FspFsvolQueryFsAttributeInformation(
RtlInitUnicodeString(&FileSystemName, FsvolDeviceExtension->VolumeParams.FileSystemName);
CopyLength = sizeof L"" DRIVER_NAME - sizeof(WCHAR);
RtlCopyMemory(FileSystemNameBuf, L"" DRIVER_NAME, CopyLength);
if (0 != FileSystemName.Length)
if (0 == FileSystemName.Length ||
(L'-' == FileSystemName.Buffer[0] ||
L'/' == FileSystemName.Buffer[0] ||
L'\\' == FileSystemName.Buffer[0]))
{
FileSystemNameBuf[CopyLength / sizeof(WCHAR)] = L'-';
CopyLength += sizeof(WCHAR);
CopyLength = sizeof L"" DRIVER_NAME - sizeof(WCHAR);
RtlCopyMemory(FileSystemNameBuf, L"" DRIVER_NAME, CopyLength);
RtlCopyMemory(FileSystemNameBuf + CopyLength / sizeof(WCHAR), FileSystemName.Buffer,
FileSystemName.Length);
CopyLength += FileSystemName.Length;
}
else
{
CopyLength = FileSystemName.Length;
RtlCopyMemory(FileSystemNameBuf, FileSystemName.Buffer, CopyLength);
}
Info->FileSystemNameLength = CopyLength;
if (Buffer + CopyLength > BufferEnd)