[NTVDM]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 26 Apr 2014 09:40:55 +0000 (09:40 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Sat, 26 Apr 2014 09:40:55 +0000 (09:40 +0000)
DPRINT1 the error code returned by DosLoadExecutable.

svn path=/branches/ntvdm/; revision=62973

subsystems/ntvdm/dos/dos32krnl/dos.c
subsystems/ntvdm/ntvdm.c

index 5b7ad70..f8f214a 100644 (file)
@@ -1283,6 +1283,7 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType,
                       LPCSTR ProgramName,
                       PDOS_EXEC_PARAM_BLOCK Parameters)
 {
+    DWORD Result;
     DWORD BinaryType;
     LPVOID Environment = NULL;
     VDM_COMMAND_INFO CommandInfo;
@@ -1361,14 +1362,15 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType,
             GetNextVDMCommand(&CommandInfo);
 
             /* Load the executable */
-            if (DosLoadExecutable(LoadType,
-                                  AppName,
-                                  CmdLine,
-                                  Env,
-                                  &Parameters->StackLocation,
-                                  &Parameters->EntryPoint) != ERROR_SUCCESS)
-            {
-                DisplayMessage(L"Could not load '%S'", AppName);
+            Result= DosLoadExecutable(LoadType,
+                                      AppName,
+                                      CmdLine,
+                                      Env,
+                                      &Parameters->StackLocation,
+                                      &Parameters->EntryPoint);
+            if (Result != ERROR_SUCCESS)
+            {
+                DisplayMessage(L"Could not load '%S'. Error: %u", AppName, Result);
                 break;
             }
 
index 6c7099d..88cd8ab 100644 (file)
@@ -379,6 +379,7 @@ VOID ConsoleCleanup(VOID)
 
 DWORD WINAPI CommandThreadProc(LPVOID Parameter)
 {
+    DWORD Result;
     VDM_COMMAND_INFO CommandInfo;
     CHAR CmdLine[MAX_PATH];
     CHAR AppName[MAX_PATH];
@@ -414,14 +415,11 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
 
         /* Start the process from the command line */
         DPRINT1("Starting '%s'...\n", AppName);
-        if (DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
-                              AppName,
-                              CmdLine,
-                              Env,
-                              NULL,
-                              NULL) != ERROR_SUCCESS)
+
+        Result = DosLoadExecutable(DOS_LOAD_AND_EXECUTE, AppName, CmdLine, Env, NULL, NULL);
+        if (Result != ERROR_SUCCESS)
         {
-            DisplayMessage(L"Could not start '%S'", AppName);
+            DisplayMessage(L"Could not start '%S'. Error: %u", AppName, Result);
             break;
         }
 
@@ -437,6 +435,8 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
 
 INT wmain(INT argc, WCHAR *argv[])
 {
+    DWORD Result;
+
 #ifdef STANDALONE
     CHAR ApplicationName[MAX_PATH];
     CHAR CommandLine[DOS_CMDLINE_LENGTH];
@@ -506,15 +506,17 @@ INT wmain(INT argc, WCHAR *argv[])
 #else
 
     /* Start the process from the command line */
-    DPRINT1("Starting '%s'...\n", CommandLine);
-    if (DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
-                          ApplicationName,
-                          CommandLine,
-                          GetEnvironmentStrings(),
-                          NULL,
-                          NULL) != ERROR_SUCCESS)
+    DPRINT1("Starting '%s'...\n", ApplicationName);
+
+    Result = DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
+                               ApplicationName,
+                               CommandLine,
+                               GetEnvironmentStrings(),
+                               NULL,
+                               NULL);
+    if (Result != ERROR_SUCCESS)
     {
-        DisplayMessage(L"Could not start '%S'", ApplicationName);
+        DisplayMessage(L"Could not start '%S'. Error: %u", ApplicationName, Result);
         goto Cleanup;
     }