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

vlc: set default DLL directories

parent e5d458a7
...@@ -61,6 +61,25 @@ static char *FromWide (const wchar_t *wide) ...@@ -61,6 +61,25 @@ static char *FromWide (const wchar_t *wide)
return out; return out;
} }
#if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
static BOOL SetDefaultDllDirectories_(DWORD flags)
{
HMODULE h = GetModuleHandle(TEXT("kernel32.dll"));
if (h == NULL)
return FALSE;
BOOL WINAPI (*SetDefaultDllDirectoriesReal)(DWORD);
SetDefaultDllDirectoriesReal = GetProcAddress(h,
"SetDefaultDllDirectories");
if (SetDefaultDllDirectoriesReal == NULL)
return FALSE;
return SetDefaultDllDirectoriesReal(flags);
}
# define SetDefaultDllDirectories SetDefaultDllDirectories_
#endif
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int nCmdShow ) int nCmdShow )
...@@ -104,6 +123,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ...@@ -104,6 +123,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
FreeLibrary(h_Kernel32); FreeLibrary(h_Kernel32);
} }
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
/* Args */ /* Args */
wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc); wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
if (wargv == NULL) if (wargv == NULL)
......
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