From 28ba9b68895dac52cf46906480875eb1d4e2cd75 Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 4 Aug 2010 19:35:22 +0000 Subject: * win/tclWin32Dll.c (asciiProcs, unicodeProcs): * win/tclWinLoad.c (TclpDlopen): 'load' use LoadLibraryEx with * win/tclWinInt.h (TclWinProcs): LOAD_WITH_ALTERED_SEARCH_PATH to prefer dependent DLLs in same dir as loaded DLL. --- ChangeLog | 5 +++++ win/tclWin32Dll.c | 6 +++--- win/tclWinInt.h | 4 ++-- win/tclWinLoad.c | 8 +++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37ef6d..6881964 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-08-04 Jeff Hobbs + * win/tclWin32Dll.c (asciiProcs, unicodeProcs): + * win/tclWinLoad.c (TclpDlopen): 'load' use LoadLibraryEx with + * win/tclWinInt.h (TclWinProcs): LOAD_WITH_ALTERED_SEARCH_PATH to + prefer dependent DLLs in same dir as loaded DLL. + * win/Makefile.in (%.${OBJEXT}): better implicit rules support 2010-08-04 Andreas Kupries diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 3b2b0a0..45c9b83 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWin32Dll.c,v 1.63 2010/03/11 13:35:23 nijtmans Exp $ + * RCS: @(#) $Id: tclWin32Dll.c,v 1.64 2010/08/04 19:35:22 hobbs Exp $ */ #include "tclWinInt.h" @@ -142,7 +142,7 @@ static TclWinProcs asciiProcs = { (DWORD (WINAPI *)(DWORD, TCHAR *)) GetTempPathA, (BOOL (WINAPI *)(const TCHAR *, TCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD, TCHAR *, DWORD)) GetVolumeInformationA, - (HINSTANCE (WINAPI *)(const TCHAR *)) LoadLibraryA, + (HINSTANCE (WINAPI *)(const TCHAR *, HANDLE, DWORD)) LoadLibraryExA, (TCHAR (WINAPI *)(TCHAR *, const TCHAR *)) lstrcpyA, (BOOL (WINAPI *)(const TCHAR *, const TCHAR *)) MoveFileA, (BOOL (WINAPI *)(const TCHAR *)) RemoveDirectoryA, @@ -201,7 +201,7 @@ static TclWinProcs unicodeProcs = { (DWORD (WINAPI *)(DWORD, TCHAR *)) GetTempPathW, (BOOL (WINAPI *)(const TCHAR *, TCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD, TCHAR *, DWORD)) GetVolumeInformationW, - (HINSTANCE (WINAPI *)(const TCHAR *)) LoadLibraryW, + (HINSTANCE (WINAPI *)(const TCHAR *, HANDLE, DWORD)) LoadLibraryExW, (TCHAR (WINAPI *)(TCHAR *, const TCHAR *)) lstrcpyW, (BOOL (WINAPI *)(const TCHAR *, const TCHAR *)) MoveFileW, (BOOL (WINAPI *)(const TCHAR *)) RemoveDirectoryW, diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 8d02d0e..b60991d 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinInt.h,v 1.35 2010/03/07 14:39:25 nijtmans Exp $ + * RCS: @(#) $Id: tclWinInt.h,v 1.36 2010/08/04 19:35:22 hobbs Exp $ */ #ifndef _TCLWININT @@ -66,7 +66,7 @@ typedef struct TclWinProcs { DWORD (WINAPI *getTempPathProc)(DWORD, TCHAR *); BOOL (WINAPI *getVolumeInformationProc)(const TCHAR *, TCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD, TCHAR *, DWORD); - HINSTANCE (WINAPI *loadLibraryProc)(const TCHAR *); + HINSTANCE (WINAPI *loadLibraryExProc)(const TCHAR *, HANDLE, DWORD); TCHAR (WINAPI *lstrcpyProc)(TCHAR *, const TCHAR *); BOOL (WINAPI *moveFileProc)(const TCHAR *, const TCHAR *); BOOL (WINAPI *removeDirectoryProc)(const TCHAR *); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index b5924e6..6fd44d1 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinLoad.c,v 1.30 2010/05/11 14:47:12 nijtmans Exp $ + * RCS: @(#) $Id: tclWinLoad.c,v 1.31 2010/08/04 19:35:22 hobbs Exp $ */ #include "tclWinInt.h" @@ -77,7 +77,8 @@ TclpDlopen( */ nativeName = Tcl_FSGetNativePath(pathPtr); - hInstance = tclWinProcs->loadLibraryProc(nativeName); + hInstance = tclWinProcs->loadLibraryExProc(nativeName, NULL, + LOAD_WITH_ALTERED_SEARCH_PATH); if (hInstance == NULL) { /* * Let the OS loader examine the binary search path for whatever @@ -89,7 +90,8 @@ TclpDlopen( const char *fileName = Tcl_GetString(pathPtr); nativeName = tclWinProcs->utf2tchar(fileName, -1, &ds); - hInstance = tclWinProcs->loadLibraryProc(nativeName); + hInstance = tclWinProcs->loadLibraryExProc(nativeName, NULL, + LOAD_WITH_ALTERED_SEARCH_PATH); Tcl_DStringFree(&ds); } -- cgit v0.12