mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
sys: FspFsvolQueryFsAttributeInformation: allow file system to fully specify file system name
tst: memfs: add -F FileSystemName option
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user