mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
winfsp-tests: setvolinfo_test: bug fix for when running without admin privileges
This commit is contained in:
parent
f3c6609308
commit
2e5af0c6ef
@ -572,54 +572,55 @@ void setvolinfo_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout)
|
|||||||
Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs));
|
Prefix ? L"" : L"\\\\?\\GLOBALROOT", Prefix ? Prefix : memfs_volumename(memfs));
|
||||||
|
|
||||||
Success = SetVolumeLabelW(FilePath, L"12345678901234567890123456789012");
|
Success = SetVolumeLabelW(FilePath, L"12345678901234567890123456789012");
|
||||||
ASSERT(Success);
|
if (Success)
|
||||||
|
|
||||||
Success = GetVolumeInformationW(FilePath,
|
|
||||||
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
|
||||||
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
|
||||||
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
|
||||||
ASSERT(Success);
|
|
||||||
if (-1 != Flags)
|
|
||||||
{
|
{
|
||||||
ASSERT(0 == wcscmp(VolumeLabelBuf, L"12345678901234567890123456789012"));
|
Success = GetVolumeInformationW(FilePath,
|
||||||
ASSERT(255 == MaxComponentLength);
|
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
||||||
ASSERT(0 != (FileSystemFlags &
|
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
||||||
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
||||||
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
ASSERT(Success);
|
||||||
}
|
if (-1 != Flags)
|
||||||
|
{
|
||||||
|
ASSERT(0 == wcscmp(VolumeLabelBuf, L"12345678901234567890123456789012"));
|
||||||
|
ASSERT(255 == MaxComponentLength);
|
||||||
|
ASSERT(0 != (FileSystemFlags &
|
||||||
|
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
||||||
|
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
||||||
|
}
|
||||||
|
|
||||||
Success = SetVolumeLabelW(FilePath, L"TestLabel");
|
Success = SetVolumeLabelW(FilePath, L"TestLabel");
|
||||||
ASSERT(Success);
|
ASSERT(Success);
|
||||||
|
|
||||||
Success = GetVolumeInformationW(FilePath,
|
Success = GetVolumeInformationW(FilePath,
|
||||||
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
||||||
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
||||||
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
||||||
ASSERT(Success);
|
ASSERT(Success);
|
||||||
if (-1 != Flags)
|
if (-1 != Flags)
|
||||||
{
|
{
|
||||||
ASSERT(0 == wcscmp(VolumeLabelBuf, L"TestLabel"));
|
ASSERT(0 == wcscmp(VolumeLabelBuf, L"TestLabel"));
|
||||||
ASSERT(255 == MaxComponentLength);
|
ASSERT(255 == MaxComponentLength);
|
||||||
ASSERT(0 != (FileSystemFlags &
|
ASSERT(0 != (FileSystemFlags &
|
||||||
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
||||||
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Success = SetVolumeLabelW(FilePath, L"123456789012345678901234567890123");
|
Success = SetVolumeLabelW(FilePath, L"123456789012345678901234567890123");
|
||||||
ASSERT(Success);
|
ASSERT(Success);
|
||||||
|
|
||||||
Success = GetVolumeInformationW(FilePath,
|
Success = GetVolumeInformationW(FilePath,
|
||||||
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
VolumeLabelBuf, sizeof VolumeLabelBuf,
|
||||||
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
&VolumeSerialNumber, &MaxComponentLength, &FileSystemFlags,
|
||||||
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
FileSystemNameBuf, sizeof FileSystemNameBuf);
|
||||||
ASSERT(Success);
|
ASSERT(Success);
|
||||||
if (-1 != Flags)
|
if (-1 != Flags)
|
||||||
{
|
{
|
||||||
ASSERT(0 == wcscmp(VolumeLabelBuf, L"12345678901234567890123456789012"));
|
ASSERT(0 == wcscmp(VolumeLabelBuf, L"12345678901234567890123456789012"));
|
||||||
ASSERT(255 == MaxComponentLength);
|
ASSERT(255 == MaxComponentLength);
|
||||||
ASSERT(0 != (FileSystemFlags &
|
ASSERT(0 != (FileSystemFlags &
|
||||||
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
(FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK | FILE_PERSISTENT_ACLS)));
|
||||||
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
ASSERT(0 == wcscmp(FileSystemNameBuf, L"WinFsp"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memfs_stop(memfs);
|
memfs_stop(memfs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user