Changeset 9537 for trunk/src/kernel32/winexepeldr.cpp
- Timestamp:
- Dec 20, 2002, 12:39:43 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winexepeldr.cpp
r9533 r9537 1 /* $Id: winexepeldr.cpp,v 1.2 0 2002-12-20 10:38:58sandervl Exp $ */1 /* $Id: winexepeldr.cpp,v 1.21 2002-12-20 11:39:41 sandervl Exp $ */ 2 2 3 3 /* … … 46 46 47 47 48 extern char szErrorTitle[];49 48 extern char szErrorModule[]; 50 49 … … 58 57 // (not other options available at this time) 59 58 //****************************************************************************** 60 BOOL WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine, 61 char *peoptions, 62 ULONG reservedMem, ULONG ulPEOffset, 63 BOOL fConsoleApp, BOOL fVioConsole) 59 DWORD WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine, 60 char *peoptions, 61 ULONG reservedMem, ULONG ulPEOffset, 62 BOOL fConsoleApp, BOOL fVioConsole, 63 char *pszErrorModule, ULONG cbErrorModule) 64 64 { 65 65 APIRET rc; … … 76 76 rc = DosGetInfoBlocks(&ptib, &ppib); 77 77 if(rc) { 78 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szInteralErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 79 delete WinExe; 80 return FALSE; 78 delete WinExe; 79 return LDRERROR_INTERNAL; 81 80 } 82 81 //Handle special pe cmd line options here (/OPT:[x1=y,x2=z,..]) … … 123 122 if(WinExe->isConsoleApp()) 124 123 { 125 124 dprintf(("Console application!\n")); 126 125 127 APIRETrc = iConsoleInit(fVioConsole); /* initialize console subsystem */128 129 126 rc = iConsoleInit(fVioConsole); /* initialize console subsystem */ 127 if (rc != NO_ERROR) /* check for errors */ 128 dprintf(("KERNEL32:Win32Image:Init ConsoleInit failed with %u.\n", rc)); 130 129 } 131 130 132 131 OS2SetExceptionHandler(&exceptFrame); 133 if(WinExe->init(reservedMem, ulPEOffset) == FALSE) 132 rc = WinExe->init(reservedMem, ulPEOffset); 133 if(rc != LDRERROR_SUCCESS) 134 134 { 135 135 if(szErrorModule[0] != 0) { 136 char szErrorMsg[128]; 137 138 sprintf(szErrorMsg, "Can't execute %s due to bad or missing %s", OSLibStripPath(szFileName), szErrorModule); 139 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 136 strncpy(pszErrorModule, szErrorModule, cbErrorModule-1); 137 pszErrorModule[cbErrorModule-1] = 0; 140 138 } 141 139 delete WinExe; 142 140 OS2UnsetExceptionHandler(&exceptFrame); 143 return FALSE;141 return rc; 144 142 } 145 143 OS2UnsetExceptionHandler(&exceptFrame); … … 158 156 delete WinExe; 159 157 160 return TRUE;158 return LDRERROR_SUCCESS; 161 159 } 162 160 //****************************************************************************** … … 167 165 Win32PeLdrImage(szFileName, TRUE) 168 166 { 169 dprintf(("Win32PeLdrExe ctor: %s", szFileName));170 this->fConsoleApp = fConsoleApp;167 dprintf(("Win32PeLdrExe ctor: %s", szFileName)); 168 this->fConsoleApp = fConsoleApp; 171 169 172 //SvL: set temporary full path here as console init needs it173 setFullPath(szFileName);170 //SvL: set temporary full path here as console init needs it 171 setFullPath(szFileName); 174 172 } 175 173 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.