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

Rémi Denis-Courmont git at videolan.org
Fri Nov 18 19:37:46 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 18 20:13:34 2016 +0200| [5714803ead8f22dd08bd1549fbb775845ca210a4] | committer: Rémi Denis-Courmont

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5714803ead8f22dd08bd1549fbb775845ca210a4
---

 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 e9e0bd5..d2d5451 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -65,16 +65,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