Changeset 3390 for trunk/src


Ignore:
Timestamp:
Apr 15, 2000, 6:32:35 PM (25 years ago)
Author:
sandervl
Message:

dll search order changes

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/makefile

    r3206 r3390  
    1 # $Id: makefile,v 1.92 2000-03-23 19:23:46 sandervl Exp $
     1# $Id: makefile,v 1.93 2000-04-15 16:32:35 sandervl Exp $
    22
    33#
     
    2323#CFLAGS   = $(CFLAGS) -DDEBUG
    2424#CXXFLAGS = $(CXXFLAGS) /Fa+
    25 
     25#LD2FLAGS = /nologo /DE /noe /map /NOD /dbgpack /packcode /packdata /exepack:2
     26#CXXFLAGS = $(CXXFLAGS) /Ti+
    2627
    2728# Object files. All objects should be prefixed with $(OBJDIR)!
  • trunk/src/kernel32/winimagebase.cpp

    r3382 r3390  
    1 /* $Id: winimagebase.cpp,v 1.12 2000-04-15 12:43:31 sandervl Exp $ */
     1/* $Id: winimagebase.cpp,v 1.13 2000-04-15 16:32:35 sandervl Exp $ */
    22
    33/*
     
    3636#include "oslibdos.h"
    3737#include "initterm.h"
     38#include "directory.h"
    3839#include <win\virtual.h>
    3940
     
    144145        strcat(szFullName,".DLL");
    145146  }
     147
    146148  //search order:
    147   //1) current dir
    148   //2) exe dir
     149  //1) exe dir
     150  //2) current dir
    149151  //3) windows system dir (kernel32 path)
    150   //4) path
    151   dllfile = OSLibDosOpen(szFullName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
    152   if(dllfile == NULL) {//search in libpath for dll
    153         strcpy(modname, WinExe->getFullPath());
    154         //remove file name from full path
    155         imagepath = modname + strlen(modname) - 1;
    156         while(*imagepath != '\\') imagepath--;
    157         imagepath[1] = 0;
    158         strcat(modname, szFileName);
    159         dllfile = OSLibDosOpen(modname, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     152  //4) windows dir
     153  //5) path
     154  strcpy(modname, WinExe->getFullPath());
     155  //remove file name from full path
     156  imagepath = modname + strlen(modname) - 1;
     157  while(*imagepath != '\\') imagepath--;
     158  imagepath[1] = 0;
     159  strcat(modname, szFullName);
     160  dllfile = OSLibDosOpen(modname, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     161  if(dllfile == NULL) {
     162        strcpy(modname, szFullName);
     163        dllfile = OSLibDosOpen(szFullName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
    160164        if(dllfile == NULL) {
    161                 strcpy(modname, kernel32Path);
    162                 strcat(modname, szFileName);
     165                strcpy(modname, InternalGetSystemDirectoryA());
     166                strcat(modname, "\\");
     167                strcat(modname, szFullName);
    163168                dllfile = OSLibDosOpen(modname, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
    164169                if(dllfile == NULL) {
    165                         OSLibDosSearchPath(OSLIB_SEARCHENV, "PATH", szFullName, szFullName, cchFullFileName);
    166                 }
    167                 else {
    168                         strcpy(szFullName, modname);
    169                         OSLibDosClose(dllfile);
     170                        strcpy(modname, InternalGetWindowsDirectoryA());
     171                        strcat(modname, "\\");
     172                        strcat(modname, szFullName);
     173                        dllfile = OSLibDosOpen(modname, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE);
     174                        if(dllfile == NULL) {
     175                                OSLibDosSearchPath(OSLIB_SEARCHENV, "PATH", szFullName, modname, sizeof(modname));
     176                        }
    170177                }
    171178        }
    172         else {
    173                 strcpy(szFullName, modname);
    174                 OSLibDosClose(dllfile);
    175         }
    176   }
    177   else  OSLibDosClose(dllfile);
     179  }
     180  strcpy(szFullName, modname);
     181  if(dllfile) OSLibDosClose(dllfile);
    178182}
    179183//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.