Changeset 1002


Ignore:
Timestamp:
Sep 21, 1999, 8:35:01 PM (26 years ago)
Author:
sandervl
Message:

Update for new kernel32 images classes

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:27 sandervl Exp $
     1# $Id: makefile,v 1.9 1999-09-21 18:35:01 sandervl Exp $
    22
    33#
     
    4646initterm.obj: initterm.cpp
    4747misc.obj: misc.cpp
    48 pe.obj: pe.cpp pe.h $(PDWIN32_INCLUDE)\winimage.h $(PDWIN32_INCLUDE)\winexe.h
     48pe.obj: pe.cpp pe.h $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winexebase.h $(PDWIN32_INCLUDE)\exceptions.h ..\kernel32\exceptutil.h
    4949
    5050clean:
  • TabularUnified trunk/src/peldr/pe.cpp

    r720 r1002  
    1 /* $Id: pe.cpp,v 1.8 1999-08-28 07:38:15 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.9 1999-09-21 18:35:01 sandervl Exp $ */
    22
    33/*
     
    2525#include <win32type.h>
    2626#include <misc.h>
    27 #include <winexe.h>
    28 #include <windll.h>
     27#include <winexepeldr.h>
    2928#include <wprocess.h>
    3029#include "pe.h"
    31 #include "exceptions.h"
    32 #include "..\kernel32\exceptutil.h"
    3330
    3431char INFO_BANNER[]      = "Usage: PE winexe commandline";
     
    6966 HAB    hab = 0;                             /* PM anchor block handle       */
    7067 HMQ    hmq = 0;                             /* Message queue handle         */
    71  char  *szCmdLine;
    7268 char   exeName[CCHMAXPATH];
    73  PPIB   ppib;
    74  PTIB   ptib;
    75  Win32Exe *WinExe;
    7669 APIRET  rc;
    7770 HMODULE hmodPMWin = 0, hmodKernel32 = 0;
    78  WINEXCEPTION_FRAME exceptFrame;
    7971
    8072  rc = DosLoadModule(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin);
     
    8678
    8779  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);
    9181
    9282  if ((hab = MyWinInitialize(0)) == 0L) /* Initialize PM     */
     
    10595        strcat(exeName, ".EXE");
    10696  }
    107   WinExe = CreateWin32Exe(exeName);
    108   if(WinExe == NULL) {
     97  if(CreateWin32Exe(exeName, ReserveMem()) == FALSE) {
    10998        MyWinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szMemErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
    11099        goto fail;
    111100  }
    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 spaces
    120         szCmdLine++;
    121   while(*szCmdLine != ' ' && *szCmdLine )       //skip pe (.exe)
    122         szCmdLine++;
    123   while(*szCmdLine == ' ' && *szCmdLine )       //skip spaces
    124         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;
    137101
    138102  if(hmq) MyWinDestroyMsgQueue( hmq );             /* Tidy up...                   */
Note: See TracChangeset for help on using the changeset viewer.