Changeset 622 for trunk/src


Ignore:
Timestamp:
Aug 22, 1999, 4:25:13 PM (26 years ago)
Author:
sandervl
Message:

PE loader bugfixes

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

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

    r612 r622  
    1 /* $Id: winimage.cpp,v 1.12 1999-08-21 19:47:30 sandervl Exp $ */
     1/* $Id: winimage.cpp,v 1.13 1999-08-22 14:24:35 sandervl Exp $ */
    22
    33/*
     
    6262    imageVirtBase(-1), realBaseAddress(0), imageVirtEnd(0),
    6363    nrNameExports(0), nrOrdExports(0), nameexports(NULL), ordexports(NULL),
    64     szFileName(NULL), NameTable(NULL), Win32Table(NULL), fullpath(NULL),
     64    NameTable(NULL), Win32Table(NULL), fullpath(NULL),
    6565    tlsAddress(0), tlsIndexAddr(0), tlsInitSize(0), tlsTotalSize(0), tlsCallBackAddr(0), tlsIndex(-1),
    6666    pResSection(NULL), pResDir(NULL), winres(NULL), VersionId(-1)
     
    7575    foutInit = TRUE;
    7676  }
    77   this->szFileName = szFileName;
     77  strcpy(this->szFileName, szFileName);
    7878
    7979  strcpy(szModule, StripPath(szFileName));
     
    9898    imageVirtBase(-1), realBaseAddress(0), imageVirtEnd(0),
    9999    nrNameExports(0), nrOrdExports(0), nameexports(NULL), ordexports(NULL),
    100     szFileName(NULL), NameTable(NULL), Win32Table(NULL), fullpath(NULL),
     100    NameTable(NULL), Win32Table(NULL), fullpath(NULL),
    101101    tlsAddress(0), tlsIndexAddr(0), tlsInitSize(0), tlsTotalSize(0), tlsCallBackAddr(0), tlsIndex(-1),
    102102    pResSection(NULL), pResDir(NULL), winres(NULL)
     
    106106#endif
    107107  OS2ImageInit(hinstance, NameTableId, Win32TableId);
     108
     109  szFileName[0] = 0;
    108110
    109111  char *name = OS2GetDllName(hinstance);
     
    422424        return(FALSE);
    423425  }
    424   entryPoint = realBaseAddress + oh.AddressOfEntryPoint;
     426  if(oh.AddressOfEntryPoint) {
     427        entryPoint = realBaseAddress + oh.AddressOfEntryPoint;
     428  }
     429  else {
     430        fout << "EntryPoint == NULL" << endl;
     431        entryPoint = NULL;
     432  }
    425433
    426434  if(tlsDir != NULL) {
  • trunk/src/kernel32/wprocess.cpp

    r617 r622  
    1 /* $Id: wprocess.cpp,v 1.24 1999-08-22 11:11:11 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.25 1999-08-22 14:24:35 sandervl Exp $ */
    22
    33/*
     
    369369static HINSTANCE iLoadLibraryA(LPCTSTR lpszLibFile)
    370370{
     371 char        modname[CCHMAXPATH];
    371372 HINSTANCE   hDll;
    372373 Win32Dll   *module;
     
    382383  }
    383384
    384   if(Win32Image::isPEImage((char *)lpszLibFile)) {
    385     module = Win32Dll::findModule((char *)lpszLibFile);
     385  strcpy(modname, lpszLibFile);
     386  strupr(modname);
     387  if(!strstr(modname, ".DLL")) {
     388        strcat(modname,".DLL");
     389  }
     390
     391  if(Win32Image::isPEImage((char *)modname)) {
     392    module = Win32Dll::findModule((char *)modname);
    386393    if(module) {//don't load it again
    387394        module->AddRef();
     
    389396    }
    390397
    391     module = new Win32Dll((char *)lpszLibFile);
     398    module = new Win32Dll((char *)modname);
    392399    if(module == NULL)
    393400        return(0);
Note: See TracChangeset for help on using the changeset viewer.