Ignore:
Timestamp:
Jun 15, 2001, 11:42:49 AM (24 years ago)
Author:
bird
Message:

Corrected Pe2Lx bug in LoadLibrary. Added isPe2LxDLL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/windllpeldr.cpp

    r4523 r6015  
    1 /* $Id: windllpeldr.cpp,v 1.8 2000-10-23 13:42:44 sandervl Exp $ */
     1/* $Id: windllpeldr.cpp,v 1.9 2001-06-15 09:42:48 bird Exp $ */
    22
    33/*
     
    1616#define INCL_DOSMISC             /* DOS Miscellanous values  */
    1717#define INCL_WIN
    18 #include <os2wrap.h>    //Odin32 OS/2 api wrappers
     18#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    1919#include <stdio.h>
    2020#include <string.h>
     
    3131#include "oslibdos.h"
    3232
    33 #define DBG_LOCALLOG    DBG_windllpeldr
     33#define DBG_LOCALLOG    DBG_windllpeldr
    3434#include "dbglocal.h"
    3535
     
    3737//******************************************************************************
    3838//******************************************************************************
    39 Win32PeLdrDll::Win32PeLdrDll(char *szDllName, Win32ImageBase *parentImage) 
    40                 : Win32ImageBase(-1), 
    41                   Win32DllBase(-1, 0, parentImage), 
     39Win32PeLdrDll::Win32PeLdrDll(char *szDllName, Win32ImageBase *parentImage)
     40                : Win32ImageBase(-1),
     41                  Win32DllBase(-1, 0, parentImage),
    4242                  Win32PeLdrImage(szDllName, FALSE)
    4343{
     
    6363  strupr(szFileName);
    6464  if(!strchr(szFileName, (int)'.')) {
    65         strcat(szFileName, DLL_EXTENSION);
     65    strcat(szFileName, DLL_EXTENSION);
    6666  }
    6767  dllfile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
    6868  if(dllfile == NULL) {//search in libpath for dll
    69         syspath = getenv("WIN32LIBPATH");
    70         if(syspath) {
    71                 strcpy(modname, syspath);
    72                 if(modname[strlen(modname)-1] != '\\') {
    73                         strcat(modname, "\\");
    74                 }
    75                 strcat(modname, szFileName);
    76                 strcpy(szFileName, modname);
    77         }
     69    syspath = getenv("WIN32LIBPATH");
     70    if(syspath) {
     71        strcpy(modname, syspath);
     72        if(modname[strlen(modname)-1] != '\\') {
     73            strcat(modname, "\\");
     74        }
     75        strcat(modname, szFileName);
     76        strcpy(szFileName, modname);
     77    }
    7878  }
    79   else  OSLibDosClose(dllfile);
     79  else  OSLibDosClose(dllfile);
    8080  fRet = Win32PeLdrImage::init(0);
    8181  dllEntryPoint = (WIN32DLLENTRY)entryPoint;
    8282
    8383  if(!(fh.Characteristics & IMAGE_FILE_DLL)) {
    84         //executable loaded as dll; don't call entrypoint
    85         dprintf(("WARNING: Exe %s loaded as dll; entrypoint not called", szFileName));
    86         dllEntryPoint = NULL;
     84    //executable loaded as dll; don't call entrypoint
     85    dprintf(("WARNING: Exe %s loaded as dll; entrypoint not called", szFileName));
     86    dllEntryPoint = NULL;
    8787  }
    8888  return fRet;
     
    9090//******************************************************************************
    9191//******************************************************************************
    92 BOOL Win32PeLdrDll::isLxDll()
     92BOOL Win32PeLdrDll::isPe2LxDll() const
    9393{
    9494  return FALSE;
     
    9696//******************************************************************************
    9797//******************************************************************************
     98BOOL Win32PeLdrDll::isLxDll() const
     99{
     100  return FALSE;
     101}
     102//******************************************************************************
     103//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.