From 017e5020897868646ac748863d0082682da8e7ad Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 13 Sep 2013 21:50:49 -0400 Subject: [PATCH] roken: win32 dlopen use LoadLibraryEx AltSearchPaths LoadLibrary() is unable to load DLLs which are being loaded from a global side by side assembly directory. Instead, use LoadLibraryEx() with LOAD_WITH_ALTERED_SEARCH_PATH This permits a DLL to be loaded from the WinSxs tree when a fully qualified path is provided. Change-Id: I0e5da1a8610c6b571f73c0e7b0beabeecbbb3b77 --- lib/roken/dlfcn_w32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/roken/dlfcn_w32.c b/lib/roken/dlfcn_w32.c index 32cdf7c7a..837e9e4e4 100644 --- a/lib/roken/dlfcn_w32.c +++ b/lib/roken/dlfcn_w32.c @@ -144,7 +144,7 @@ dlopen(const char *fn, int flags) old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS); - hm = LoadLibrary(fn); + hm = LoadLibraryEx(fn, 0, LOAD_WITH_ALTERED_SEARCH_PATH); if (hm == NULL) { set_error_from_last();