[vlc-commits] win32: don´t clobber proce =?UTF-8?Q?ss=20DLL=20directories=20?=(fixes #17663)

Rémi Denis-Courmont git at videolan.org
Wed Mar 8 23:43:50 CET 2017


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 18 20:13:34 2016 +0200| [494d320e473e055d316c9b69411f9fe55c2cfc3b] | committer: Jean-Baptiste Kempf

win32: don´t clobber process DLL directories (fixes #17663)

LibVLC has zero business messing with process state. This breaks
apps other than VLC and other libraries in the same process.

(cherry picked from commit 5714803ead8f22dd08bd1549fbb775845ca210a4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=494d320e473e055d316c9b69411f9fe55c2cfc3b
---

 src/win32/specific.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/win32/specific.c b/src/win32/specific.c
index 376d672..3321165 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -63,16 +63,13 @@ void system_Init(void)
         fputs("Error: cannot initialize Winsocks\n", stderr);
 
 #if !VLC_WINSTORE_APP
-    typedef BOOL (WINAPI *SetDefaultDllDirectoriesFunc)( DWORD DirectoryFlags);
-    SetDefaultDllDirectoriesFunc pf_SetDefDllDir = (SetDefaultDllDirectoriesFunc)
-        GetProcAddress( GetModuleHandleW(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
-
-    if( pf_SetDefDllDir ) {
-        pf_SetDefDllDir( LOAD_LIBRARY_SEARCH_SYSTEM32 );
+# if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+    if (GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
+                                       "SetDefaultDllDirectories") != NULL)
+# endif /* FIXME: not reentrant */
         LoadLibraryFlags = LOAD_LIBRARY_SEARCH_APPLICATION_DIR |
                            LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR |
                            LOAD_LIBRARY_SEARCH_SYSTEM32;
-    }
 #endif
 }
 



More information about the vlc-commits mailing list