Commit 170e5561 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

win32: call SetErrorMode() while still single-threaded

(This is required by MSDN.)
parent 81055423
......@@ -26,10 +26,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
#ifdef WIN32
# include <windows.h>
#endif
static void version (void)
{
......@@ -47,6 +49,9 @@ static void usage (const char *path)
int main (int argc, char *argv[])
{
#ifdef WIN32
SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
static const struct option opts[] =
{
{ "force", no_argument, NULL, 'f' },
......
......@@ -79,6 +79,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
putenv("VLC_DATA_PATH=Z:"TOP_SRCDIR"/share");
#endif
SetErrorMode(SEM_FAILCRITICALERRORS);
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
/* SetProcessDEPPolicy */
......
......@@ -58,13 +58,9 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
return -1;
module_handle_t handle;
/* FIXME: this is not thread-safe -- Courmisch */
UINT mode = SetErrorMode (SEM_FAILCRITICALERRORS);
SetErrorMode (mode|SEM_FAILCRITICALERRORS);
handle = LoadLibraryW (wfile);
SetErrorMode (mode);
free (wfile);
if( handle == 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