tst: winfsp-tests: add --share-prefix option:

- this accommodates network file systems that have mapped drives
This commit is contained in:
Bill Zissimopoulos 2017-01-30 16:07:44 -08:00
parent 178200fd63
commit d1bb65a998

View File

@ -295,6 +295,20 @@ int main(int argc, char *argv[])
WinFspNetTests = 0;
}
}
else if (0 == strncmp("--share-prefix=", a, sizeof "--share-prefix=" - 1))
{
/* hack to allow name queries on network file systems with mapped drives */
WCHAR SharePrefixBuf[MAX_PATH];
if (0 != MultiByteToWideChar(CP_UTF8, 0,
a + sizeof "--share-prefix=" - 1, -1, SharePrefixBuf, MAX_PATH))
{
rmarg(argv, argc, argi);
OptSharePrefixLength = (ULONG)(wcslen(SharePrefixBuf) * sizeof(WCHAR));
}
}
else if (0 == strcmp("--no-traverse", a))
{
if (LookupPrivilegeValueW(0, SE_CHANGE_NOTIFY_NAME, &OptNoTraverseLuid) &&