Commit ba108368 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

win32: hard-code LoadLibrary flags

This fixes a data race on multiple LibVLC instances.

Note: This patch does NOT fix the many other LoadLibrary() calls.
parent 13bf3774
......@@ -33,8 +33,6 @@
#include <windows.h>
#include <wchar.h>
extern DWORD LoadLibraryFlags;
static char *GetWindowsError( void )
{
wchar_t wmsg[256];
......@@ -64,7 +62,7 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
DWORD mode;
if (SetThreadErrorMode (SEM_FAILCRITICALERRORS, &mode) != 0)
{
handle = LoadLibraryExW (wfile, NULL, LoadLibraryFlags );
handle = LoadLibraryExW(wfile, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
SetThreadErrorMode (mode, NULL);
}
#else
......
......@@ -39,8 +39,6 @@
typedef UINT MMRESULT;
#endif
DWORD LoadLibraryFlags = 0;
static int system_InitWSA(int hi, int lo)
{
WSADATA data;
......@@ -62,14 +60,6 @@ void system_Init(void)
{
if (system_InitWSA(2, 2) && system_InitWSA(1, 1))
fputs("Error: cannot initialize Winsocks\n", stderr);
#if !VLC_WINSTORE_APP
# if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
if (GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
"SetDefaultDllDirectories") != NULL)
# endif /* FIXME: not reentrant */
LoadLibraryFlags = LOAD_LIBRARY_SEARCH_SYSTEM32;
#endif
}
/*****************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment