[vlc-commits] win32: use SetThreadErrorMode() if available

Rémi Denis-Courmont git at videolan.org
Fri Feb 7 22:10:58 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Feb  7 23:09:26 2014 +0200| [4b5b89cd4b60a16b8de1e916ef297640853f241c] | committer: Rémi Denis-Courmont

win32: use SetThreadErrorMode() if available

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

 src/win32/plugin.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/win32/plugin.c b/src/win32/plugin.c
index 31c06d6..6b861aa 100644
--- a/src/win32/plugin.c
+++ b/src/win32/plugin.c
@@ -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 )



More information about the vlc-commits mailing list