Changeset 1002
- Timestamp:
- Sep 21, 1999, 8:35:01 PM (26 years ago)
- Location:
- trunk/src/peldr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/peldr/makefile ¶
r610 r1002 1 # $Id: makefile,v 1. 8 1999-08-21 19:11:27sandervl Exp $1 # $Id: makefile,v 1.9 1999-09-21 18:35:01 sandervl Exp $ 2 2 3 3 # … … 46 46 initterm.obj: initterm.cpp 47 47 misc.obj: misc.cpp 48 pe.obj: pe.cpp pe.h $(PDWIN32_INCLUDE)\winimage .h $(PDWIN32_INCLUDE)\winexe.h48 pe.obj: pe.cpp pe.h $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\exceptions.h ..\kernel32\exceptutil.h 49 49 50 50 clean: -
TabularUnified trunk/src/peldr/pe.cpp ¶
r720 r1002 1 /* $Id: pe.cpp,v 1. 8 1999-08-28 07:38:15sandervl Exp $ */1 /* $Id: pe.cpp,v 1.9 1999-09-21 18:35:01 sandervl Exp $ */ 2 2 3 3 /* … … 25 25 #include <win32type.h> 26 26 #include <misc.h> 27 #include <winexe.h> 28 #include <windll.h> 27 #include <winexepeldr.h> 29 28 #include <wprocess.h> 30 29 #include "pe.h" 31 #include "exceptions.h"32 #include "..\kernel32\exceptutil.h"33 30 34 31 char INFO_BANNER[] = "Usage: PE winexe commandline"; … … 69 66 HAB hab = 0; /* PM anchor block handle */ 70 67 HMQ hmq = 0; /* Message queue handle */ 71 char *szCmdLine;72 68 char exeName[CCHMAXPATH]; 73 PPIB ppib;74 PTIB ptib;75 Win32Exe *WinExe;76 69 APIRET rc; 77 70 HMODULE hmodPMWin = 0, hmodKernel32 = 0; 78 WINEXCEPTION_FRAME exceptFrame;79 71 80 72 rc = DosLoadModule(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin); … … 86 78 87 79 rc = DosLoadModule(exeName, sizeof(exeName), "KERNEL32.DLL", &hmodKernel32); 88 rc = DosQueryProcAddr(hmodKernel32, 0, "CreateWin32Exe", (PFN *)&CreateWin32Exe); 89 rc = DosQueryProcAddr(hmodKernel32, 0, "OS2SetExceptionHandler", (PFN *)&Krnl32SetExceptionHandler); 90 rc = DosQueryProcAddr(hmodKernel32, 0, "OS2UnsetExceptionHandler", (PFN *)&Krnl32UnsetExceptionHandler); 80 rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@8", (PFN *)&CreateWin32Exe); 91 81 92 82 if ((hab = MyWinInitialize(0)) == 0L) /* Initialize PM */ … … 105 95 strcat(exeName, ".EXE"); 106 96 } 107 WinExe = CreateWin32Exe(exeName); 108 if(WinExe == NULL) { 97 if(CreateWin32Exe(exeName, ReserveMem()) == FALSE) { 109 98 MyWinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szMemErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 110 99 goto fail; 111 100 } 112 rc = DosGetInfoBlocks(&ptib, &ppib);113 if(rc) {114 MyWinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szInteralErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);115 delete WinExe;116 goto fail;117 }118 szCmdLine = ppib->pib_pchcmd;119 while(*szCmdLine == ' ' && *szCmdLine ) //skip leading spaces120 szCmdLine++;121 while(*szCmdLine != ' ' && *szCmdLine ) //skip pe (.exe)122 szCmdLine++;123 while(*szCmdLine == ' ' && *szCmdLine ) //skip spaces124 szCmdLine++;125 126 WinExe->setCommandLine(szCmdLine);127 128 Krnl32SetExceptionHandler(&exceptFrame);129 if(WinExe->init(ReserveMem()) == FALSE) {130 delete WinExe;131 goto fail;132 }133 Krnl32UnsetExceptionHandler(&exceptFrame);134 WinExe->start();135 136 delete WinExe;137 101 138 102 if(hmq) MyWinDestroyMsgQueue( hmq ); /* Tidy up... */
Note:
See TracChangeset
for help on using the changeset viewer.