DPRINT1 the error code returned by DosLoadExecutable.


svn path=/branches/ntvdm/; revision=62973
This commit is contained in:
Aleksandar Andrejevic 2014-04-26 09:40:55 +00:00
parent e5df0c4dfe
commit 2e1e346378
2 changed files with 26 additions and 22 deletions

View file

@ -1283,6 +1283,7 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType,
LPCSTR ProgramName, LPCSTR ProgramName,
PDOS_EXEC_PARAM_BLOCK Parameters) PDOS_EXEC_PARAM_BLOCK Parameters)
{ {
DWORD Result;
DWORD BinaryType; DWORD BinaryType;
LPVOID Environment = NULL; LPVOID Environment = NULL;
VDM_COMMAND_INFO CommandInfo; VDM_COMMAND_INFO CommandInfo;
@ -1361,14 +1362,15 @@ WORD DosCreateProcess(DOS_EXEC_TYPE LoadType,
GetNextVDMCommand(&CommandInfo); GetNextVDMCommand(&CommandInfo);
/* Load the executable */ /* Load the executable */
if (DosLoadExecutable(LoadType, Result= DosLoadExecutable(LoadType,
AppName, AppName,
CmdLine, CmdLine,
Env, Env,
&Parameters->StackLocation, &Parameters->StackLocation,
&Parameters->EntryPoint) != ERROR_SUCCESS) &Parameters->EntryPoint);
if (Result != ERROR_SUCCESS)
{ {
DisplayMessage(L"Could not load '%S'", AppName); DisplayMessage(L"Could not load '%S'. Error: %u", AppName, Result);
break; break;
} }

View file

@ -379,6 +379,7 @@ VOID ConsoleCleanup(VOID)
DWORD WINAPI CommandThreadProc(LPVOID Parameter) DWORD WINAPI CommandThreadProc(LPVOID Parameter)
{ {
DWORD Result;
VDM_COMMAND_INFO CommandInfo; VDM_COMMAND_INFO CommandInfo;
CHAR CmdLine[MAX_PATH]; CHAR CmdLine[MAX_PATH];
CHAR AppName[MAX_PATH]; CHAR AppName[MAX_PATH];
@ -414,14 +415,11 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
/* Start the process from the command line */ /* Start the process from the command line */
DPRINT1("Starting '%s'...\n", AppName); DPRINT1("Starting '%s'...\n", AppName);
if (DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
AppName, Result = DosLoadExecutable(DOS_LOAD_AND_EXECUTE, AppName, CmdLine, Env, NULL, NULL);
CmdLine, if (Result != ERROR_SUCCESS)
Env,
NULL,
NULL) != ERROR_SUCCESS)
{ {
DisplayMessage(L"Could not start '%S'", AppName); DisplayMessage(L"Could not start '%S'. Error: %u", AppName, Result);
break; break;
} }
@ -437,6 +435,8 @@ DWORD WINAPI CommandThreadProc(LPVOID Parameter)
INT wmain(INT argc, WCHAR *argv[]) INT wmain(INT argc, WCHAR *argv[])
{ {
DWORD Result;
#ifdef STANDALONE #ifdef STANDALONE
CHAR ApplicationName[MAX_PATH]; CHAR ApplicationName[MAX_PATH];
CHAR CommandLine[DOS_CMDLINE_LENGTH]; CHAR CommandLine[DOS_CMDLINE_LENGTH];
@ -506,15 +506,17 @@ INT wmain(INT argc, WCHAR *argv[])
#else #else
/* Start the process from the command line */ /* Start the process from the command line */
DPRINT1("Starting '%s'...\n", CommandLine); DPRINT1("Starting '%s'...\n", ApplicationName);
if (DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
ApplicationName, Result = DosLoadExecutable(DOS_LOAD_AND_EXECUTE,
CommandLine, ApplicationName,
GetEnvironmentStrings(), CommandLine,
NULL, GetEnvironmentStrings(),
NULL) != ERROR_SUCCESS) 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; goto Cleanup;
} }