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,
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)
Result= DosLoadExecutable(LoadType,
AppName,
CmdLine,
Env,
&Parameters->StackLocation,
&Parameters->EntryPoint);
if (Result != ERROR_SUCCESS)
{
DisplayMessage(L"Could not load '%S'", AppName);
DisplayMessage(L"Could not load '%S'. Error: %u", AppName, Result);
break;
}

View 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;
}