- Timestamp:
- Jun 11, 2001, 12:32:18 AM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagebase.cpp
r5448 r5959 1 /* $Id: winimagebase.cpp,v 1.3 1 2001-04-02 22:51:58sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.32 2001-06-10 22:32:17 sandervl Exp $ */ 2 2 3 3 /* … … 204 204 //the Characteristics member of the file header structure) 205 205 //****************************************************************************** 206 ULONG Win32ImageBase::isPEImage(char *szFileName, DWORD *Characteristics, DWORD *subsystem) 206 ULONG Win32ImageBase::isPEImage(char *szFileName, DWORD *Characteristics, 207 DWORD *subsystem, DWORD *fNEExe) 207 208 { 208 209 char filename[CCHMAXPATH]; … … 219 220 int nSections, i; 220 221 222 if(fNEExe) 223 *fNEExe = FALSE; 224 221 225 if (!findDll(szFileName, filename, sizeof(filename))) 222 226 { … … 279 283 } 280 284 281 if(GetPEFileHeader (win32file, &fh) == FALSE) { 285 if(GetPEFileHeader (win32file, &fh) == FALSE) 286 { 287 if(*(WORD *)PE_HEADER(win32file) == IMAGE_OS2_SIGNATURE) { 288 if(fNEExe) 289 *fNEExe = TRUE; 290 } 282 291 goto failure; 283 292 } -
trunk/src/kernel32/winimagebase.h
r5448 r5959 1 /* $Id: winimagebase.h,v 1.1 8 2001-04-02 22:51:58sandervl Exp $ */1 /* $Id: winimagebase.h,v 1.19 2001-06-10 22:32:17 sandervl Exp $ */ 2 2 3 3 /* … … 97 97 //returns ERROR_SUCCESS or error code (Characteristics will contain 98 98 //the Characteristics member of the file header structure) 99 static ULONG isPEImage(char *szFileName, DWORD *Characteristics, DWORD *subsystem = NULL);99 static ULONG isPEImage(char *szFileName, DWORD *Characteristics, DWORD *subsystem, DWORD *fNEExe = NULL); 100 100 static BOOL findDll(const char *pszFileName, char *pszFullName, 101 101 int cchFullName, const char *pszAltPath = NULL); -
trunk/src/kernel32/winimagepeldr.cpp
r5932 r5959 1 /* $Id: winimagepeldr.cpp,v 1.8 6 2001-06-08 11:04:25sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.87 2001-06-10 22:32:17 sandervl Exp $ */ 2 2 3 3 /* … … 1524 1524 } 1525 1525 1526 if(isPEImage(modname, NULL ) != ERROR_SUCCESS_W)1526 if(isPEImage(modname, NULL, NULL) != ERROR_SUCCESS_W) 1527 1527 {//LX image, so let OS/2 do all the work for us 1528 1528 APIRET rc; -
trunk/src/kernel32/wprocess.cpp
r5939 r5959 1 /* $Id: wprocess.cpp,v 1.12 2 2001-06-09 19:46:01sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.123 2001-06-10 22:32:18 sandervl Exp $ */ 2 2 3 3 /* … … 786 786 787 787 //test if dll is in PE or LX format 788 fPE = Win32ImageBase::isPEImage(szModname, &Characteristics );788 fPE = Win32ImageBase::isPEImage(szModname, &Characteristics, NULL); 789 789 790 790 /** @sketch … … 1695 1695 dprintf(("KERNEL32: CreateProcess %s\n", cmdline)); 1696 1696 1697 DWORD Characteristics, SubSystem ;1698 if(Win32ImageBase::isPEImage(exename, &Characteristics, &SubSystem ) == 0) {1697 DWORD Characteristics, SubSystem, fNEExe; 1698 if(Win32ImageBase::isPEImage(exename, &Characteristics, &SubSystem, &fNEExe) == 0) { 1699 1699 char *lpszPE; 1700 1700 if(SubSystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) { … … 1726 1726 lpProcessInfo); 1727 1727 } 1728 else {//16 bits windows app 1728 else 1729 if(fNEExe) {//16 bits windows app 1730 char *newcmdline; 1731 1732 newcmdline = (char *)malloc(strlen(cmdline) + 16); 1733 sprintf(newcmdline, "w16odin.exe %s", cmdline); 1734 free(cmdline); 1735 cmdline = newcmdline; 1736 //Force Open32 to use DosStartSession (DosExecPgm won't do) 1737 dwCreationFlags |= CREATE_NEW_PROCESS_GROUP; 1738 rc = O32_CreateProcess("w16odin.exe", (LPCSTR)cmdline, lpProcessAttributes, 1739 lpThreadAttributes, bInheritHandles, dwCreationFlags, 1740 lpEnvironment, lpCurrentDirectory, lpStartupInfo, 1741 lpProcessInfo); 1742 } 1743 else {//os/2 app?? 1729 1744 rc = O32_CreateProcess(NULL, (LPCSTR)cmdline,lpProcessAttributes, 1730 1745 lpThreadAttributes, bInheritHandles, dwCreationFlags,
Note:
See TracChangeset
for help on using the changeset viewer.