[vlc-commits] win32: don´t clobber process error mode
Rémi Denis-Courmont
git at videolan.org
Fri Nov 18 19:15:21 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 18 19:46:27 2016 +0200| [281252c2dc66637795d5d5ed3b3dc54f84fee974] | committer: Rémi Denis-Courmont
win32: don´t clobber process error mode
Regression from e44f6165c138a1e715b5dd738155f9eb6dc90143
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=281252c2dc66637795d5d5ed3b3dc54f84fee974
---
src/win32/plugin.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/win32/plugin.c b/src/win32/plugin.c
index 3f3bb81..22ee38c 100644
--- a/src/win32/plugin.c
+++ b/src/win32/plugin.c
@@ -49,9 +49,10 @@ static BOOL WINAPI SetThreadErrorModeFallback(DWORD mode, DWORD *oldmode)
if (SetThreadErrorModeReal != NULL)
return SetThreadErrorModeReal(mode, oldmode);
-# if (_WIN32_WINNT >= 0x600)
- DWORD curmode = GetErrorMode();
-# else
+# if (_WIN32_WINNT < _WIN32_WINNT_VISTA)
+ /* As per libvlc_new() documentation, the calling process is responsible
+ * for setting a proper error mode on Windows 2008 and earlier versions.
+ * This is only a sanity check. */
UINT WINAPI (*GetErrorModeReal)(void);
DWORD curmode = 0;
@@ -59,14 +60,9 @@ static BOOL WINAPI SetThreadErrorModeFallback(DWORD mode, DWORD *oldmode)
if (GetErrorModeReal != NULL)
curmode = GetErrorModeReal();
else
- {
- /* We are on XP, 2003, 2003/R2 or some special versions of Vista:
- No SetThreadErrorMode, no GetErrorMode.
- We will set the mode for the whole process, which is quite bad,
- but is our only solution */
- SetErrorMode( mode );
- return TRUE;
- }
+ curmode = SEM_FAILCRITICALERRORS;
+# else
+ DWORD curmode = GetErrorMode();
# endif
/* Extra flags should be OK. Missing flags are NOT OK. */
if ((mode & curmode) != mode)
More information about the vlc-commits
mailing list