win32: use SetThreadErrorMode() if available

This commit is contained in:
Rémi Denis-Courmont 2014-02-07 23:09:26 +02:00
parent 170e5561c1
commit 4b5b89cd4b

View File

@ -57,10 +57,18 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
if (wfile == NULL)
return -1;
module_handle_t handle;
handle = LoadLibraryW (wfile);
module_handle_t handle = NULL;
#if (_WIN32_WINNT >= 0x601)
DWORD mode;
if (SetThreadErrorMode (SEM_FAILCRITICALERRORS, &mode) == 0)
#endif
{
handle = LoadLibraryW (wfile);
#if (_WIN32_WINNT >= 0x601)
SetThreadErrorMode (mode, NULL);
#endif
}
free (wfile);
if( handle == NULL )