launcher, launchctl: add quit command on debug version of launcher

This commit is contained in:
Bill Zissimopoulos
2016-05-14 21:00:02 -07:00
parent 08a02d7b35
commit 768a393342
3 changed files with 33 additions and 1 deletions

View File

@ -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();