mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
tst: passthrough-fuse:
- When building for Windows (rather than Cygwin or POSIX OS) allow the syntax C$\Path as an alternative to C:\Path.
This commit is contained in:
parent
eefaad241d
commit
5617d09edc
@ -274,6 +274,26 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (3 <= argc && '-' != argv[argc - 2][0] && '-' != argv[argc - 1][0])
|
if (3 <= argc && '-' != argv[argc - 2][0] && '-' != argv[argc - 1][0])
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN64) || defined(_WIN32)
|
||||||
|
/*
|
||||||
|
* When building for Windows (rather than Cygwin or POSIX OS)
|
||||||
|
* allow the syntax C$\Path as an alternative to C:\Path. This
|
||||||
|
* allows us to run the file system under the WinFsp.Launcher
|
||||||
|
* and start it using commands like:
|
||||||
|
*
|
||||||
|
* net use z: \\passthrough-fuse\C$\Path
|
||||||
|
*/
|
||||||
|
if ((
|
||||||
|
('A' <= argv[argc - 2][0] && argv[argc - 2][0] <= 'Z') ||
|
||||||
|
('a' <= argv[argc - 2][0] && argv[argc - 2][0] <= 'z')
|
||||||
|
) &&
|
||||||
|
'$' == argv[argc - 2][1] &&
|
||||||
|
('\\' == argv[argc - 2][2] || '/' == argv[argc - 2][2]))
|
||||||
|
{
|
||||||
|
argv[argc - 2][1] = ':';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ptfs.rootdir = realpath(argv[argc - 2], 0); /* memory freed at process end */
|
ptfs.rootdir = realpath(argv[argc - 2], 0); /* memory freed at process end */
|
||||||
argv[argc - 2] = argv[argc - 1];
|
argv[argc - 2] = argv[argc - 1];
|
||||||
argc--;
|
argc--;
|
||||||
|
@ -816,11 +816,12 @@ static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
|||||||
if (0 != P && L'\\' != P[1])
|
if (0 != P && L'\\' != P[1])
|
||||||
{
|
{
|
||||||
P = wcschr(P + 1, L'\\');
|
P = wcschr(P + 1, L'\\');
|
||||||
if (0 != P && L'$' == P[2] &&
|
if (0 != P &&
|
||||||
(
|
(
|
||||||
(L'A' <= P[1] && P[1] <= L'Z') ||
|
(L'A' <= P[1] && P[1] <= L'Z') ||
|
||||||
(L'a' <= P[1] && P[1] <= L'z')
|
(L'a' <= P[1] && P[1] <= L'z')
|
||||||
))
|
) &&
|
||||||
|
L'$' == P[2])
|
||||||
{
|
{
|
||||||
StringCbPrintf(PassThroughBuf, sizeof PassThroughBuf, L"%c:%s", P[1], P + 3);
|
StringCbPrintf(PassThroughBuf, sizeof PassThroughBuf, L"%c:%s", P[1], P + 3);
|
||||||
PassThrough = PassThroughBuf;
|
PassThrough = PassThroughBuf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user