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

Jean-Baptiste Kempf jb at videolan.org
Fri Nov 18 19:20:42 CET 2016


I'm not sure I totally agree on this (but it is minor, I agree), but I
believe you meant 17663, no?

On Fri, 18 Nov 2016, at 19:15, Rémi Denis-Courmont wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 18
> 20:13:34 2016 +0200| [1eb18305aa3185cd0c6d4d5aa22ff8b5cd3f5755] |
> committer: Rémi Denis-Courmont
> 
> win32: don´t clobber process DLL directories (fixes #17633)
> 
> 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=1eb18305aa3185cd0c6d4d5aa22ff8b5cd3f5755
> ---
> 
>  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
>  }
>  
> 
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list