mirror of
https://github.com/winfsp/winfsp.git
synced 2025-09-13 04:38:30 -05:00
launcher: path transform language
This commit is contained in:
35
tst/launcher-tests/echo.c
Normal file
35
tst/launcher-tests/echo.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Compile:
|
||||
* - cl -I"%ProgramFiles(x86)%\WinFsp\inc" "%ProgramFiles(x86)%\WinFsp\lib\winfsp-x64.lib" echo.c
|
||||
*
|
||||
* Register:
|
||||
* - echo.reg (fix Executable path first)
|
||||
*
|
||||
* Run:
|
||||
* - launchctl-x64 start echo 1 \foo\bar\baz
|
||||
*
|
||||
* Expect:
|
||||
* - "\foo\bar\baz" "bar:baz" "DOMAIN\\USERNAME"
|
||||
*/
|
||||
|
||||
#include <winfsp/winfsp.h>
|
||||
|
||||
int wmain(int argc, wchar_t *argv[])
|
||||
{
|
||||
WCHAR buf[512], *bufp;
|
||||
int len;
|
||||
|
||||
bufp = buf;
|
||||
for (int i = 0; argc > i; i++)
|
||||
{
|
||||
len = lstrlenW(argv[i]);
|
||||
memcpy(bufp, argv[i], len * sizeof(WCHAR));
|
||||
bufp += len;
|
||||
*bufp++ = '\n';
|
||||
}
|
||||
*bufp = '\0';
|
||||
|
||||
FspServiceLog(EVENTLOG_INFORMATION_TYPE, L"%s", buf);
|
||||
|
||||
return 0;
|
||||
}
|
BIN
tst/launcher-tests/echo.reg
Normal file
BIN
tst/launcher-tests/echo.reg
Normal file
Binary file not shown.
32
tst/launcher-tests/secret.c
Normal file
32
tst/launcher-tests/secret.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Compile:
|
||||
* - cl secret.c
|
||||
*
|
||||
* Register:
|
||||
* - secret.reg (fix Executable path first)
|
||||
*
|
||||
* Run:
|
||||
* - launchctl-x64 startWithSecret secret 1 nopass
|
||||
* - launchctl-x64 startWithSecret secret 1 foobar
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char pass[256];
|
||||
|
||||
gets(pass);
|
||||
if (0 == strcmp("foobar", pass))
|
||||
{
|
||||
puts("OK");
|
||||
fprintf(stderr, "OK secret=\"%s\"\n", pass);
|
||||
}
|
||||
else
|
||||
{
|
||||
puts("KO");
|
||||
fprintf(stderr, "KO secret=\"%s\"\n", pass);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
tst/launcher-tests/secret.reg
Normal file
BIN
tst/launcher-tests/secret.reg
Normal file
Binary file not shown.
Reference in New Issue
Block a user