[vlc-devel] commit: Win32: fail safe when loading plugins ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Sep 17 06:49:41 CEST 2008
vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Sep 16 23:24:33 2008 +0300| [6af3f923df3693d9d1313714d06ce862c681a6ba] | committer: Jean-Baptiste Kempf
Win32: fail safe when loading plugins
(cherry picked from commit 490dfd5c281fca4492f0cb8c09c209ea8264acd5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6af3f923df3693d9d1313714d06ce862c681a6ba
---
src/modules/os.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/modules/os.c b/src/modules/os.c
index 213d5ae..a449ad7 100644
--- a/src/modules/os.c
+++ b/src/modules/os.c
@@ -183,11 +183,17 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
wchar_t psz_wfile[MAX_PATH];
MultiByteToWideChar( CP_ACP, 0, psz_file, -1, psz_wfile, MAX_PATH );
+ /* FIXME: this is not thread-safe -- Courmisch */
+ UINT mode = SetErrorMode (SEM_FAILCRITICALERRORS);
+ SetErrorMode (mode|SEM_FAILCRITICALERRORS);
+
#ifdef UNDER_CE
handle = LoadLibrary( psz_wfile );
#else
handle = LoadLibraryW( psz_wfile );
#endif
+ SetErrorMode (mode);
+
if( handle == NULL )
{
char *psz_err = GetWindowsError();
More information about the vlc-devel
mailing list