mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-03 01:12:58 -05:00
launcher, launchctl: add quit command on debug version of launcher
This commit is contained in:
@ -193,6 +193,21 @@ int list(PWSTR PipeBuf, ULONG PipeBufSize)
|
||||
return call_pipe_and_report(PipeBuf, (ULONG)((P - PipeBuf) * sizeof(WCHAR)), PipeBufSize);
|
||||
}
|
||||
|
||||
int quit(PWSTR PipeBuf, ULONG PipeBufSize)
|
||||
{
|
||||
/* works only against DEBUG version of launcher */
|
||||
|
||||
PWSTR P;
|
||||
|
||||
if (PipeBufSize < 1 * sizeof(WCHAR))
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
P = PipeBuf;
|
||||
*P++ = LauncherQuit;
|
||||
|
||||
return call_pipe_and_report(PipeBuf, (ULONG)((P - PipeBuf) * sizeof(WCHAR)), PipeBufSize);
|
||||
}
|
||||
|
||||
int wmain(int argc, wchar_t **argv)
|
||||
{
|
||||
PWSTR PipeBuf = 0;
|
||||
@ -239,6 +254,15 @@ int wmain(int argc, wchar_t **argv)
|
||||
|
||||
return list(PipeBuf, PIPE_BUFFER_SIZE);
|
||||
}
|
||||
else
|
||||
if (0 == lstrcmpW(L"quit", argv[0]))
|
||||
{
|
||||
if (1 != argc)
|
||||
usage();
|
||||
|
||||
/* works only against DEBUG version of launcher */
|
||||
return quit(PipeBuf, PIPE_BUFFER_SIZE);
|
||||
}
|
||||
else
|
||||
usage();
|
||||
|
||||
|
Reference in New Issue
Block a user