mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
launcher, launchctl: command line arguments are now numbered %1 to %9
This commit is contained in:
parent
ec2494433b
commit
5491187e1d
@ -210,7 +210,7 @@ int wmain(int argc, wchar_t **argv)
|
|||||||
|
|
||||||
if (0 == lstrcmpW(L"start", argv[0]))
|
if (0 == lstrcmpW(L"start", argv[0]))
|
||||||
{
|
{
|
||||||
if (3 > argc || argc > 12)
|
if (3 > argc || argc > 11)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
return start(PipeBuf, PIPE_BUFFER_SIZE, argv[1], argv[2], argc - 3, argv + 3);
|
return start(PipeBuf, PIPE_BUFFER_SIZE, argv[1], argv[2], argc - 3, argv + 3);
|
||||||
|
@ -96,8 +96,8 @@ static NTSTATUS SvcInstanceReplaceArguments(PWSTR String, ULONG Argc, PWSTR *Arg
|
|||||||
{
|
{
|
||||||
case L'%':
|
case L'%':
|
||||||
P++;
|
P++;
|
||||||
if (L'0' <= *P && *P <= '9' && Argc > (ULONG)(*P - L'0'))
|
if (L'1' <= *P && *P <= '9' && Argc > (ULONG)(*P - L'1'))
|
||||||
Length += SvcInstanceArgumentLength(Argv[*P - L'0']);
|
Length += SvcInstanceArgumentLength(Argv[*P - L'1']);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Length++;
|
Length++;
|
||||||
@ -116,8 +116,8 @@ static NTSTATUS SvcInstanceReplaceArguments(PWSTR String, ULONG Argc, PWSTR *Arg
|
|||||||
{
|
{
|
||||||
case L'%':
|
case L'%':
|
||||||
P++;
|
P++;
|
||||||
if (L'0' <= *P && *P <= '9' && Argc > (ULONG)(*P - L'0'))
|
if (L'1' <= *P && *P <= '9' && Argc > (ULONG)(*P - L'1'))
|
||||||
Q = SvcInstanceArgumentCopy(Q, Argv[*P - L'0']);
|
Q = SvcInstanceArgumentCopy(Q, Argv[*P - L'1']);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Q++;
|
Q++;
|
||||||
@ -708,7 +708,7 @@ static VOID SvcPipeTransact(HANDLE ClientToken, PWSTR PipeBuf, PULONG PSize)
|
|||||||
|
|
||||||
PWSTR P = PipeBuf, PipeBufEnd = PipeBuf + *PSize / sizeof(WCHAR);
|
PWSTR P = PipeBuf, PipeBufEnd = PipeBuf + *PSize / sizeof(WCHAR);
|
||||||
PWSTR ClassName, InstanceName;
|
PWSTR ClassName, InstanceName;
|
||||||
ULONG Argc; PWSTR Argv[10];
|
ULONG Argc; PWSTR Argv[9];
|
||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
|
|
||||||
*PSize = 0;
|
*PSize = 0;
|
||||||
@ -718,7 +718,7 @@ static VOID SvcPipeTransact(HANDLE ClientToken, PWSTR PipeBuf, PULONG PSize)
|
|||||||
case LauncherSvcInstanceStart:
|
case LauncherSvcInstanceStart:
|
||||||
ClassName = SvcPipeTransactGetPart(&P, PipeBufEnd);
|
ClassName = SvcPipeTransactGetPart(&P, PipeBufEnd);
|
||||||
InstanceName = SvcPipeTransactGetPart(&P, PipeBufEnd);
|
InstanceName = SvcPipeTransactGetPart(&P, PipeBufEnd);
|
||||||
for (Argc = 0; 10 > Argc; Argc++)
|
for (Argc = 0; sizeof Argv / sizeof Argv[0] > Argc; Argc++)
|
||||||
if (0 == (Argv[Argc] = SvcPipeTransactGetPart(&P, PipeBufEnd)))
|
if (0 == (Argv[Argc] = SvcPipeTransactGetPart(&P, PipeBufEnd)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user