mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 02:32:57 +00:00
[NTVDM]
The command line in the PSP consists only of the parameters, the program name is omitted. svn path=/branches/ntvdm/; revision=60959
This commit is contained in:
parent
1ff6bc0f8f
commit
cf559336a1
1 changed files with 12 additions and 4 deletions
|
@ -1025,6 +1025,7 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
||||||
LPBYTE Address = NULL;
|
LPBYTE Address = NULL;
|
||||||
LPSTR ProgramFilePath, Parameters[256];
|
LPSTR ProgramFilePath, Parameters[256];
|
||||||
CHAR CommandLineCopy[DOS_CMDLINE_LENGTH];
|
CHAR CommandLineCopy[DOS_CMDLINE_LENGTH];
|
||||||
|
CHAR ParamString[DOS_CMDLINE_LENGTH];
|
||||||
INT ParamCount = 0;
|
INT ParamCount = 0;
|
||||||
WORD Segment = 0;
|
WORD Segment = 0;
|
||||||
WORD MaxAllocSize;
|
WORD MaxAllocSize;
|
||||||
|
@ -1040,8 +1041,6 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
||||||
/* Save a copy of the command line */
|
/* Save a copy of the command line */
|
||||||
strcpy(CommandLineCopy, CommandLine);
|
strcpy(CommandLineCopy, CommandLine);
|
||||||
|
|
||||||
// FIXME: Improve parsing (especially: "some_path\with spaces\program.exe" options)
|
|
||||||
|
|
||||||
/* Get the file name of the executable */
|
/* Get the file name of the executable */
|
||||||
ProgramFilePath = strtok(CommandLineCopy, " \t");
|
ProgramFilePath = strtok(CommandLineCopy, " \t");
|
||||||
|
|
||||||
|
@ -1052,6 +1051,15 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
||||||
ParamCount++;
|
ParamCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZeroMemory(ParamString, sizeof(ParamString));
|
||||||
|
|
||||||
|
/* Store the parameters in a string */
|
||||||
|
for (i = 0; i < ParamCount; i++)
|
||||||
|
{
|
||||||
|
strncat(ParamString, Parameters[i], DOS_CMDLINE_LENGTH - strlen(ParamString) - 1);
|
||||||
|
strncat(ParamString, " ", DOS_CMDLINE_LENGTH - strlen(ParamString) - 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Open a handle to the executable */
|
/* Open a handle to the executable */
|
||||||
FileHandle = CreateFileA(ProgramFilePath,
|
FileHandle = CreateFileA(ProgramFilePath,
|
||||||
GENERIC_READ,
|
GENERIC_READ,
|
||||||
|
@ -1124,7 +1132,7 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
||||||
|
|
||||||
/* Initialize the PSP */
|
/* Initialize the PSP */
|
||||||
DosInitializePsp(Segment,
|
DosInitializePsp(Segment,
|
||||||
CommandLine,
|
ParamString,
|
||||||
(WORD)ExeSize,
|
(WORD)ExeSize,
|
||||||
EnvBlock);
|
EnvBlock);
|
||||||
|
|
||||||
|
@ -1193,7 +1201,7 @@ BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock)
|
||||||
|
|
||||||
/* Initialize the PSP */
|
/* Initialize the PSP */
|
||||||
DosInitializePsp(Segment,
|
DosInitializePsp(Segment,
|
||||||
CommandLine,
|
ParamString,
|
||||||
MaxAllocSize,
|
MaxAllocSize,
|
||||||
EnvBlock);
|
EnvBlock);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue