Fix command line pass issue

This commit is contained in:
Jack251970 2025-06-13 13:07:55 +08:00
parent 61717dcd50
commit 393d106c15

View file

@ -911,7 +911,9 @@ retry:
// 7. Start the new process with that primary token
fixed (char* appPtr = app)
fixed (char* cmdLinePtr = cmdLine)
// Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line
// So we add one more dash before the command line to make command line work correctly
fixed (char* cmdLinePtr = $"- {cmdLine}")
fixed (char* currentDirPtr = currentDir)
{
if (!PInvoke.CreateProcessWithToken(hPrimaryToken,