Changeset 4501 for trunk/src


Ignore:
Timestamp:
Oct 20, 2000, 1:45:25 PM (25 years ago)
Author:
sandervl
Message:

build special VIO version of PE loader

Location:
trunk/src/peldr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/peldr/makefile

    r3037 r4501  
    1 # $Id: makefile,v 1.16 2000-03-07 11:11:10 bird Exp $
     1# $Id: makefile,v 1.17 2000-10-20 11:45:25 sandervl Exp $
    22
    33#
     
    2727# Object files. All objects should be prefixed with $(OBJDIR)!
    2828OBJS = $(OBJDIR)\pe.obj
    29 
     29OBJS1= $(OBJDIR)\pec.obj
    3030
    3131# Target name - name of the dll without extention and path.
    32 TARGET = pe
    33 
     32TARGET  = pe
     33TARGET1 = pec
    3434
    3535# All rule - build objs, target dll, copies dll to bin and makes libs.
    3636all:    $(OBJDIR) \
    3737        $(OBJDIR)\$(TARGET).exe \
    38         $(PDWIN32_BIN)\$(TARGET).exe
     38        $(PDWIN32_BIN)\$(TARGET).exe \
     39        $(OBJDIR)\$(TARGET1).exe \
     40        $(PDWIN32_BIN)\$(TARGET1).exe
    3941
    4042
     
    4749    $(LD2) $(LD2FLAGS_ODINCRT) @$(OBJDIR)\$(TARGET).lrf
    4850
     51$(OBJDIR)\$(TARGET1).exe: $(OBJS1) $(OBJDIR)\$(TARGET1).lrf
     52    $(LD2) $(LD2FLAGS_ODINCRT) @$(OBJDIR)\$(TARGET1).lrf
     53
     54$(PDWIN32_BIN)\$(TARGET1).exe: $(OBJDIR)\$(TARGET1).exe
     55    cd $(OBJDIR)
     56    $(MAPSYM) $(TARGET1).map
     57    cd ..\..
     58    $(CP) $(OBJDIR)\$(TARGET1).sym $(PDWIN32_BIN)
     59    $(CP) $** $@
     60    -$(CP) $** $(@D)..\..\$(@F)
     61    -$(CP) $(OBJDIR)\$(TARGET1).sym $(@D)..\..
     62
     63$(OBJDIR)\pec.obj:   pe.cpp
     64    $(CC) -C $(CXXFLAGS) -DCOMMAND_LINE_VERSION -Fo$@ pe.cpp
    4965
    5066# Linker file - creates the parameter file passed on to the linker.
     
    6177
    6278
     79$(OBJDIR)\$(TARGET1).lrf: makefile
     80    @echo Creating file <<$@
     81/OUT:$(OBJDIR)\$(TARGET1).exe
     82/MAP:$(OBJDIR)\$(TARGET1).map
     83/PMTYPE:vio
     84/STACK:0x100000
     85/NOBASE
     86$(OBJS1)
     87os2386.lib
     88<<keep
     89
    6390# Dep rule - makes depenencies for C, C++ and Asm files.
    6491dep:
  • trunk/src/peldr/pe.cpp

    r4445 r4501  
    1 /* $Id: pe.cpp,v 1.23 2000-10-06 15:15:25 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.24 2000-10-20 11:45:25 sandervl Exp $ */
    22
    33/*
     
    6767
    6868//should be the same as in ..\kernel32\winexepeldr.h
    69 typedef BOOL (* WIN32API WIN32CTOR)(char *, char *, char *, ULONG, BOOL);
     69typedef BOOL (* WIN32API WIN32CTOR)(char *, char *, char *, ULONG, BOOL, BOOL);
    7070
    7171WIN32CTOR   CreateWin32Exe       = 0;
     
    8888 PPIB   ppib;
    8989 char  *cmdline, *win32cmdline, *peoptions, *newcmdline;
    90  BOOL   fQuote = FALSE;
     90 BOOL   fQuote = FALSE, fVioConsole;
    9191 int    nrTries = 1;
    9292
     
    175175  }
    176176
     177#ifdef COMMAND_LINE_VERSION
     178  if(DosGetInfoBlocks(&ptib, &ppib) == 0) {
     179        //switch process type to PM so the command line app can create PM
     180        //windows
     181        ppib->pib_ultype = 3;
     182  }
     183#endif
     184
    177185  rc = DosLoadModule(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin);
    178186  rc = DosQueryProcAddr(hmodPMWin, ORD_WIN32INITIALIZE, NULL, (PFN *)&MyWinInitialize);
     
    198206        goto fail;
    199207  }
    200   rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@20", (PFN *)&CreateWin32Exe);
    201 
    202   if(CreateWin32Exe(exeName, win32cmdline, peoptions, reservedMemory, fConsoleApp) == FALSE) {
     208  rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@24", (PFN *)&CreateWin32Exe);
     209
     210#ifdef COMMAND_LINE_VERSION
     211  fVioConsole = TRUE;
     212#else
     213  fVioConsole = FALSE;
     214#endif
     215  if(CreateWin32Exe(exeName, win32cmdline, peoptions, reservedMemory, fConsoleApp, fVioConsole) == FALSE) {
    203216        goto fail;
    204217  }
Note: See TracChangeset for help on using the changeset viewer.