LPCSTR ProgramName,
PDOS_EXEC_PARAM_BLOCK Parameters)
{
+ DWORD Result;
DWORD BinaryType;
LPVOID Environment = NULL;
VDM_COMMAND_INFO CommandInfo;
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;
}
DWORD WINAPI CommandThreadProc(LPVOID Parameter)
{
+ DWORD Result;
VDM_COMMAND_INFO CommandInfo;
CHAR CmdLine[MAX_PATH];
CHAR AppName[MAX_PATH];
/* 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;
}
INT wmain(INT argc, WCHAR *argv[])
{
+ DWORD Result;
+
#ifdef STANDALONE
CHAR ApplicationName[MAX_PATH];
CHAR CommandLine[DOS_CMDLINE_LENGTH];
#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;
}