Changeset 9556 for trunk/src


Ignore:
Timestamp:
Dec 28, 2002, 2:40:10 PM (23 years ago)
Author:
sandervl
Message:

Change BEGINLIBPATH before loading any dlls

File:
1 edited

Legend:

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

    r9536 r9556  
    1 /* $Id: pe.cpp,v 1.35 2002-12-20 11:38:55 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.36 2002-12-28 13:40:10 sandervl Exp $ */
    22
    33/*
     
    4444char szExeErrorMsg[]    = "%s isn't an executable";
    4545char szInteralErrorMsg[]= "Internal Error while loading %s";
     46char szInteralErrorMsg1[]= "Internal Error";
    4647char szNoKernel32Msg[]  = "Can't load/find kernel32.dll (rc=%d, module %s)";
    4748char szDosInfoBlocks[]  = "DosInfoBlocks failed!";
     
    9899 BOOL   fQuote = FALSE, fVioConsole, fIsNEExe, fEndOfCmdLine = FALSE;
    99100 int    nrTries = 1;
     101
     102  if(DosGetInfoBlocks(&ptib, &ppib) == 0)
     103  {
     104      char *pszTemp;
     105
     106      fullpath[0] = 0;
     107      DosQueryModuleName(ppib->pib_hmte, sizeof(fullpath), fullpath);
     108
     109      strupr(fullpath);
     110#ifdef COMMAND_LINE_VERSION
     111      pszTemp = strstr(fullpath, "PEC.EXE");
     112#else
     113      pszTemp = strstr(fullpath, "PE.EXE");
     114#endif
     115      if(pszTemp == NULL) {
     116          pszErrorMsg = szInteralErrorMsg1;
     117          goto failerror;
     118      }
     119      pszTemp--; //to go trailing backslash
     120      *pszTemp = 0;
     121      strcat(fullpath, ";%BeginLIBPATH%");
     122      DosSetExtLIBPATH(fullpath, BEGIN_LIBPATH);
     123  }
    100124
    101125  if(argc >= 2) {
Note: See TracChangeset for help on using the changeset viewer.