[NTVDM]: Move the DosStartProcess dprint inside the function.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 6 May 2015 22:07:16 +0000 (22:07 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 6 May 2015 22:07:16 +0000 (22:07 +0000)
svn path=/trunk/; revision=67582

reactos/subsystems/mvdm/ntvdm/dos/dem.c
reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c

index b34d6db..9e559b8 100644 (file)
@@ -257,11 +257,6 @@ Command:
         }
 
         /* Start the process from the command line */
-        DPRINT1("Starting '%s' ('%.*s')...\n",
-                AppName,
-                CommandInfo.CmdLen >= 2 ? CommandInfo.CmdLen - 2 /* Display the command line without the terminating 0d 0a */
-                                        : CommandInfo.CmdLen,
-                CmdLine);
         Result = DosStartProcess(AppName, CmdLine, Env);
         if (Result != ERROR_SUCCESS)
         {
@@ -474,7 +469,6 @@ static VOID WINAPI DosStart(LPWORD Stack)
     }
 
     /* Start the process from the command line */
-    DPRINT1("Starting '%s' ('%s')...\n", ApplicationName, CommandLine);
     Result = DosStartProcess(ApplicationName, CommandLine,
                              SEG_OFF_TO_PTR(SYSTEM_ENV_BLOCK, 0));
     if (Result != ERROR_SUCCESS)
index 46f644d..ba44546 100644 (file)
@@ -622,6 +622,15 @@ DWORD DosStartProcess(IN LPCSTR ExecutablePath,
     DWORD Result;
     LPDWORD IntVecTable = (LPDWORD)((ULONG_PTR)BaseAddress);
 
+    SIZE_T CmdLen = strlen(CommandLine);
+    DPRINT1("Starting '%s' ('%.*s')...\n",
+            ExecutablePath,
+            /* Display the command line without the terminating 0d 0a (and skip the terminating NULL) */
+            CmdLen >= 2 ? (CommandLine[CmdLen - 2] == '\r' ? CmdLen - 2
+                                                           : CmdLen)
+                        : CmdLen,
+            CommandLine);
+
     Result = DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
                                ExecutablePath,
                                NULL,