summaryrefslogtreecommitdiff
path: root/dso/win32/dso.c
diff options
context:
space:
mode:
Diffstat (limited to 'dso/win32/dso.c')
-rw-r--r--dso/win32/dso.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c
index 3433c7e31..9681d91b5 100644
--- a/dso/win32/dso.c
+++ b/dso/win32/dso.c
@@ -69,7 +69,10 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle,
}
/* Prevent ugly popups from killing our app */
#ifndef _WIN32_WCE
- em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ if (!SetThreadErrorMode(SEM_FAILCRITICALERRORS, &em)) {
+ *res_handle = apr_pcalloc(ctx, sizeof(**res_handle));
+ return ((*res_handle)->load_error = apr_get_os_error());
+ }
#endif
os_handle = LoadLibraryExW(wpath, NULL, 0);
if (!os_handle)
@@ -87,7 +90,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle,
#endif
}
#ifndef _WIN32_WCE
- SetErrorMode(em);
+ SetThreadErrorMode(em, NULL);
#endif
*res_handle = apr_pcalloc(ctx, sizeof(**res_handle));