summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2019-05-19 17:31:16 +0000
committerivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2019-05-19 17:31:16 +0000
commit261782e842ef6dc8d5bdf05e384f9f039df92c99 (patch)
treede685325268048742aea5cb98ab86c246976218c
parent437b16abfd8da06b85ca4b02213cc975a578c75d (diff)
downloadlibapr-261782e842ef6dc8d5bdf05e384f9f039df92c99.tar.gz
win32: Remove non-unicode codepath from apr_dso_load().
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1859518 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--dso/win32/dso.c73
1 files changed, 21 insertions, 52 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c
index a2ed9a419..3433c7e31 100644
--- a/dso/win32/dso.c
+++ b/dso/win32/dso.c
@@ -60,65 +60,34 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle,
UINT em;
#endif
-#if APR_HAS_UNICODE_FS
- IF_WIN_OS_IS_UNICODE
- {
- apr_wchar_t wpath[APR_PATH_MAX];
- if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath)
- / sizeof(apr_wchar_t), path))
- != APR_SUCCESS) {
- *res_handle = apr_pcalloc(ctx, sizeof(**res_handle));
- return ((*res_handle)->load_error = rv);
- }
- /* Prevent ugly popups from killing our app */
+ apr_wchar_t wpath[APR_PATH_MAX];
+ if ((rv = utf8_to_unicode_path(wpath, sizeof(wpath)
+ / sizeof(apr_wchar_t), path))
+ != APR_SUCCESS) {
+ *res_handle = apr_pcalloc(ctx, sizeof(**res_handle));
+ return ((*res_handle)->load_error = rv);
+ }
+ /* Prevent ugly popups from killing our app */
#ifndef _WIN32_WCE
- em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ em = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
- os_handle = LoadLibraryExW(wpath, NULL, 0);
- if (!os_handle)
- os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!os_handle) {
+ os_handle = LoadLibraryExW(wpath, NULL, 0);
+ if (!os_handle)
+ os_handle = LoadLibraryExW(wpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (!os_handle) {
#ifndef _WIN32_WCE
- rv = apr_get_os_error();
+ rv = apr_get_os_error();
- os_handle = LoadLibraryExW(wpath, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
- if (os_handle) {
- rv = APR_SUCCESS;
- }
-#else
- rv = apr_get_os_error();
-#endif
+ os_handle = LoadLibraryExW(wpath, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
+ if (os_handle) {
+ rv = APR_SUCCESS;
}
-#ifndef _WIN32_WCE
- SetErrorMode(em);
+#else
+ rv = apr_get_os_error();
#endif
}
-#endif /* APR_HAS_UNICODE_FS */
-#if APR_HAS_ANSI_FS
- ELSE_WIN_OS_IS_ANSI
- {
- char fspec[APR_PATH_MAX], *p = fspec;
- /* Must convert path from / to \ notation.
- * Per PR2555, the LoadLibraryEx function is very picky about slashes.
- * Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL.
- * LoadLibrary in the MS PSDK also reveals that it -explicitly- states
- * that backslashes must be used for the LoadLibrary family of calls.
- */
- apr_cpystrn(fspec, path, sizeof(fspec));
- while ((p = strchr(p, '/')) != NULL)
- *p = '\\';
-
- /* Prevent ugly popups from killing our app */
- em = SetErrorMode(SEM_FAILCRITICALERRORS);
- os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!os_handle)
- os_handle = LoadLibraryEx(path, NULL, 0);
- if (!os_handle)
- rv = apr_get_os_error();
- else
- rv = APR_SUCCESS;
- SetErrorMode(em);
- }
+#ifndef _WIN32_WCE
+ SetErrorMode(em);
#endif
*res_handle = apr_pcalloc(ctx, sizeof(**res_handle));