Changeset 4445 for trunk/src/peldr


Ignore:
Timestamp:
Oct 6, 2000, 5:16:07 PM (25 years ago)
Author:
sandervl
Message:

changes for setting current dir of new process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/peldr/pe.cpp

    r4441 r4445  
    1 /* $Id: pe.cpp,v 1.22 2000-10-06 11:04:42 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.23 2000-10-06 15:15:25 sandervl Exp $ */
    22
    33/*
    44 * PELDR main exe loader code
    55 *
    6  * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
     6 * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl)
    77 *
     8 * Command line options:
     9 *   /OPT:[x1=y,x2=z,..]         
     10 *   x = CURDIR    -> set current directory to y
     11 *   (not other options available at this time)
    812 *
    913 * Project Odin Software License can be found in LICENSE.TXT
     
    6367
    6468//should be the same as in ..\kernel32\winexepeldr.h
    65 typedef BOOL (* WIN32API WIN32CTOR)(char *, char *, ULONG, BOOL);
     69typedef BOOL (* WIN32API WIN32CTOR)(char *, char *, char *, ULONG, BOOL);
    6670
    6771WIN32CTOR   CreateWin32Exe       = 0;
     
    8387 PTIB   ptib;
    8488 PPIB   ppib;
    85  char  *cmdline, *win32cmdline;
     89 char  *cmdline, *win32cmdline, *peoptions, *newcmdline;
    8690 BOOL   fQuote = FALSE;
    8791 int    nrTries = 1;
     
    9296                cmdline = ppib->pib_pchcmd;
    9397                cmdline += strlen(cmdline)+1;   //skip pe.exe
     98                peoptions = strstr(cmdline, "/OPT:[");
     99                if(peoptions) {
     100                        newcmdline = strchr(peoptions, ']');
     101                        if(newcmdline) {
     102                                cmdline = newcmdline+1;
     103                        }
     104                        else    DebugInt3();    //should not happen!
     105                }               
    94106                while(*cmdline == ' ')  cmdline++; //skip leading space
    95107                if(*cmdline == '"') {
     
    186198        goto fail;
    187199  }
    188   rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@16", (PFN *)&CreateWin32Exe);
    189 
    190   if(CreateWin32Exe(exeName, win32cmdline, reservedMemory, fConsoleApp) == FALSE) {
     200  rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@20", (PFN *)&CreateWin32Exe);
     201
     202  if(CreateWin32Exe(exeName, win32cmdline, peoptions, reservedMemory, fConsoleApp) == FALSE) {
    191203        goto fail;
    192204  }
Note: See TracChangeset for help on using the changeset viewer.