[BASESRV][KERNEL32][NTVDM]
[reactos.git] / subsystems / ntvdm / ntvdm.c
index be32afe..c6cc701 100644 (file)
@@ -390,6 +390,7 @@ VOID ConsoleCleanup(VOID)
 
 DWORD WINAPI CommandThreadProc(LPVOID Parameter)
 {
+    BOOLEAN First = TRUE;
     DWORD Result;
     VDM_COMMAND_INFO CommandInfo;
     CHAR CmdLine[MAX_PATH];
@@ -407,7 +408,7 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
         ZeroMemory(&CommandInfo, sizeof(CommandInfo));
 
         /* Initialize the structure members */
-        CommandInfo.VDMState = VDM_NOT_LOADED;
+        CommandInfo.VDMState = VDM_FLAG_DOS;
         CommandInfo.CmdLine = CmdLine;
         CommandInfo.CmdLen = sizeof(CmdLine);
         CommandInfo.AppName = AppName;
@@ -421,6 +422,12 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
         CommandInfo.Env = Env;
         CommandInfo.EnvLen = sizeof(Env);
 
+        if (First)
+        {
+            CommandInfo.VDMState |= VDM_FLAG_FIRST_TASK;
+            First = FALSE;
+        }
+
         /* Wait for the next available VDM */
         if (!GetNextVDMCommand(&CommandInfo)) break;