summaryrefslogtreecommitdiff
path: root/dso/win32
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-10-08 06:00:27 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2000-10-08 06:00:27 +0000
commit180c031d7303bcc6c78a83d6cce35ed39379e026 (patch)
treef7a12da2fc4ee1caef88d41b7f056cdbf4ad5b06 /dso/win32
parentf23ea9f1aeeefec034a25e6b66c5b864c2f18a73 (diff)
downloadlibapr-180c031d7303bcc6c78a83d6cce35ed39379e026.tar.gz
Movin on over from 1.3.13-dev : this patch fixes the problem of nasty
popup windows alerting an Admin that the isapi isn't working, and simplifies mod_isapi by relying on dso. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60564 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso/win32')
-rw-r--r--dso/win32/dso.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c
index e4dbad23e..be80510d5 100644
--- a/dso/win32/dso.c
+++ b/dso/win32/dso.c
@@ -61,7 +61,8 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path
apr_pool_t *ctx)
{
HINSTANCE os_handle;
- char fspec[MAX_PATH], *p;
+ char fspec[MAX_PATH], *p = fspec;
+ UINT em;
/* Must convert path from / to \ notation.
* Per PR2555, the LoadLibraryEx function is very picky about slashes.
@@ -70,11 +71,15 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path
* that backslashes must be used for the LoadLibrary family of calls.
*/
apr_cpystrn(fspec, path, MAX_PATH);
- for (p = fspec; *p; ++p)
- if (*p == '/')
- *p = '\\';
+ while (p = strchr(p, '/'))
+ *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);
+ SetErrorMode(em);
*res_handle = apr_pcalloc(ctx, sizeof(*res_handle));
if(os_handle == NULL) {