From 6503d83dee9c2c7dd30572b84f11b95f832e9309 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 26 Apr 2020 21:50:00 +0200 Subject: Disable stop-the-world windows error messages --- .travis-ci.sh | 1 - midimonster.c | 3 +++ plugin.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis-ci.sh b/.travis-ci.sh index 5272fde..39652a1 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -73,7 +73,6 @@ elif [ "$TASK" = "windows" ]; then fi # Build the lua backend but disable it by default to avoid scary error messages make -C backends lua.dll - mv backends/lua.dll backends/lua.dll.disabled travis_fold end "make_windows" if [ "$(git describe)" == "$(git describe --abbrev=0)" ]; then travis_fold start "deploy_windows" diff --git a/midimonster.c b/midimonster.c index 1065e5c..b418711 100644 --- a/midimonster.c +++ b/midimonster.c @@ -284,6 +284,9 @@ static int platform_initialize(){ if(WSAStartup(version, &wsa)){ return 1; } + + unsigned error_mode = SetErrorMode(0); + SetErrorMode(error_mode | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); #endif return 0; } diff --git a/plugin.c b/plugin.c index 56d6651..e7d8eba 100644 --- a/plugin.c +++ b/plugin.c @@ -51,7 +51,7 @@ static int plugin_attach(char* path, char* file){ char* error = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error, 0, NULL); - fprintf(stderr, "Failed to load plugin %s: %s\n", lib, error); + fprintf(stderr, "Failed to load plugin %s, check that all supporting libraries are present: %s\n", lib, error); LocalFree(error); #else fprintf(stderr, "Failed to load plugin %s: %s\n", lib, dlerror()); -- cgit v1.2.3