Changeset 1325 for trunk/src/kernel32/winexepe2lx.cpp
- Timestamp:
- Oct 17, 1999, 3:49:09 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winexepe2lx.cpp
r1274 r1325 1 /* $Id: winexepe2lx.cpp,v 1. 2 1999-10-14 01:37:56bird Exp $ */1 /* $Id: winexepe2lx.cpp,v 1.3 1999-10-17 01:49:09 bird Exp $ */ 2 2 3 3 /* … … 52 52 void WIN32API RegisterPe2LxExe(ULONG ulPe2LxVersion, HINSTANCE hinstance, ULONG ulReserved) 53 53 { 54 Win32Pe2LxExe *pWinPe2LxExe; 55 54 56 /* I/O init. */ 55 57 if (getenv("WIN32_IOPL2")) … … 73 75 74 76 /* Create Pe2Lx Exe object. */ 75 try 77 pWinPe2LxExe = new Win32Pe2LxExe(hinstance, (ulPe2LxVersion & 0x80000000UL) == 0x80000000UL); 78 if (pWinPe2LxExe == NULL) 76 79 { 77 Win32Pe2LxExe *pWinPe2LxExe; 78 pWinPe2LxExe = new Win32Pe2LxExe(hinstance, (ulPe2LxVersion & 0x80000000UL) == 0x80000000UL); 79 if (pWinPe2LxExe == NULL) 80 throw ((ULONG)ERROR_NOT_ENOUGH_MEMORY); 81 82 /* Call start (which calls the entry point). */ 83 /*DebugInt3();*/ 84 pWinPe2LxExe->start(); 85 } 86 catch (ULONG ul) 87 { 88 eprintf(("Win32Pe2LxExe creation failed! ul=%d\n", ul)); 89 DebugInt3(); 80 eprintf(("RegisterPe2LxExe: new returned a NULL-pointer\n")); 90 81 return; 91 82 } 83 if (!pWinPe2LxExe->init()) 84 { 85 eprintf(("RegisterPe2LxExe: init-method failed.\n")); 86 delete pWinPe2LxExe; 87 return; 88 } 89 90 /* Call start (which calls the entry point). */ 91 /*DebugInt3();*/ 92 pWinPe2LxExe->start(); 92 93 } 93 94 … … 102 103 * @remark Win32Pe2LxImage may throw an exception! 103 104 */ 104 Win32Pe2LxExe::Win32Pe2LxExe(HINSTANCE hinstance, BOOL fWin32k) throw(ULONG):105 Win32ImageBase(hinstance),105 Win32Pe2LxExe::Win32Pe2LxExe(HINSTANCE hinstance, BOOL fWin32k) 106 : Win32ImageBase(hinstance), 106 107 Win32ExeBase(hinstance), 107 108 Win32Pe2LxImage(hinstance, fWin32k) 108 109 { 109 fConsoleApp = pNtHdrs->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI;110 111 /* console app? */112 if (fConsoleApp)113 {114 APIRET rc;115 116 dprintf(("Console application!\n"));117 118 rc = iConsoleInit(); /* initialize console subsystem */119 if (rc != NO_ERROR) /* check for errors */120 dprintf(("KERNEL32:Win32Image:Init ConsoleInit failed with %u.\n", rc));121 }122 110 } 123 111 … … 130 118 Win32Pe2LxExe::~Win32Pe2LxExe() 131 119 { 120 132 121 } 122 123 124 /** 125 * Init object. 126 * Must be called immedeately after the object construction. 127 * @returns Success indicator. (TRUE == success) 128 * @sketch 129 * @status completely implemented. 130 * @author knut st. osmundsen 131 */ 132 BOOL Win32Pe2LxExe::init() 133 { 134 if (Win32Pe2LxImage::init()) 135 { 136 fConsoleApp = pNtHdrs->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI; 137 138 /* console app? */ 139 if (fConsoleApp) 140 { 141 APIRET rc; 142 143 dprintf(("Console application!\n")); 144 145 rc = iConsoleInit(); /* initialize console subsystem */ 146 if (rc != NO_ERROR) /* check for errors */ 147 dprintf(("KERNEL32:Win32Image:Init ConsoleInit failed with %u.\n", rc)); 148 } 149 } 150 else 151 return FALSE; 152 return TRUE; 153 } 154
Note:
See TracChangeset
for help on using the changeset viewer.