Changeset 4440 for trunk/src/kernel32/winexepeldr.cpp
- Timestamp:
- Oct 6, 2000, 1:04:02 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winexepeldr.cpp
r4351 r4440 1 /* $Id: winexepeldr.cpp,v 1.1 1 2000-10-01 12:05:57sandervl Exp $ */1 /* $Id: winexepeldr.cpp,v 1.12 2000-10-06 11:04:01 sandervl Exp $ */ 2 2 3 3 /* … … 47 47 //Called by ring 3 pe loader to create win32 executable 48 48 //****************************************************************************** 49 BOOL WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine, ULONG reservedMem) 49 BOOL WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine, 50 ULONG reservedMem, BOOL fConsoleApp) 50 51 { 51 52 APIRET rc; … … 58 59 fPeLoader = TRUE; 59 60 60 WinExe = new Win32PeLdrExe(szFileName );61 WinExe = new Win32PeLdrExe(szFileName, fConsoleApp); 61 62 62 63 rc = DosGetInfoBlocks(&ptib, &ppib); … … 81 82 82 83 if(getenv("WIN32_IOPL2")) { 83 io_init1();84 io_init1(); 84 85 } 85 86 OS2SetExceptionHandler(&exceptFrame); 87 if(WinExe->init(reservedMem) == FALSE) { 88 if(szErrorModule[0] != 0) { 89 char szErrorMsg[128]; 90 91 sprintf(szErrorMsg, "Can't execute %s due to bad or missing %s", OSLibStripPath(szFileName), szErrorModule); 92 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 93 } 94 delete WinExe; 95 return FALSE; 96 } 97 98 OS2UnsetExceptionHandler(&exceptFrame); 99 if(WinExe->isConsoleApp()) { 86 //Init console before loading executable as dlls might want to print 87 //something on the console while being loaded 88 if(WinExe->isConsoleApp()) 89 { 100 90 dprintf(("Console application!\n")); 101 91 … … 104 94 dprintf(("KERNEL32:Win32Image:Init ConsoleInit failed with %u.\n", rc)); 105 95 } 96 97 OS2SetExceptionHandler(&exceptFrame); 98 if(WinExe->init(reservedMem) == FALSE) 99 { 100 if(szErrorModule[0] != 0) { 101 char szErrorMsg[128]; 102 103 sprintf(szErrorMsg, "Can't execute %s due to bad or missing %s", OSLibStripPath(szFileName), szErrorModule); 104 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 105 } 106 delete WinExe; 107 OS2UnsetExceptionHandler(&exceptFrame); 108 return FALSE; 109 } 110 OS2UnsetExceptionHandler(&exceptFrame); 106 111 107 112 WinExe->start(); … … 113 118 //****************************************************************************** 114 119 //****************************************************************************** 115 Win32PeLdrExe::Win32PeLdrExe(char *szFileName ) :120 Win32PeLdrExe::Win32PeLdrExe(char *szFileName, BOOL fConsoleApp) : 116 121 Win32ImageBase(-1), 117 122 Win32ExeBase(-1), … … 119 124 { 120 125 dprintf(("Win32PeLdrExe ctor: %s", szFileName)); 126 this->fConsoleApp = fConsoleApp; 127 128 //SvL: set temporary full path here as console init needs it 129 setFullPath(szFileName); 121 130 } 122 131 //****************************************************************************** … … 132 141 133 142 rc = Win32PeLdrImage::init(reservedMem); 134 fConsoleApp = (oh.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI);135 143 return rc; 136 144 }
Note:
See TracChangeset
for help on using the changeset viewer.