summaryrefslogtreecommitdiff
path: root/dso/win32
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2000-05-31 02:30:27 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2000-05-31 02:30:27 +0000
commit995a6ed99276bb968b1600ad6b569e56ca8311cd (patch)
tree5ddf9d6d6878001e019443ef882e0fd562a98870 /dso/win32
parent841efd649fe20edc5ad993fd4a34e9101e912f3a (diff)
downloadlibapr-995a6ed99276bb968b1600ad6b569e56ca8311cd.tar.gz
Rework DSO error reporting to be more flexible & informative.
This patch covers os/2, unix & win32. Other platforms still need some adjustment (BeOS, AIX). Reviewed by: rbb, gstein git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60120 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso/win32')
-rw-r--r--dso/win32/dso.c11
-rw-r--r--dso/win32/dso.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c
index 8e64a56d7..d04b6a054 100644
--- a/dso/win32/dso.c
+++ b/dso/win32/dso.c
@@ -62,13 +62,16 @@ ap_status_t ap_dso_load(struct ap_dso_handle_t **res_handle, const char *path,
ap_pool_t *ctx)
{
HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ *res_handle = ap_pcalloc(ctx, sizeof(*res_handle));
+
if(os_handle == NULL) {
- return GetLastError();
+ (*res_handle)->load_error = GetLastError();
+ return (*res_handle)->load_error;
}
- *res_handle = ap_pcalloc(ctx, sizeof(*res_handle));
(*res_handle)->handle = (void*)os_handle;
(*res_handle)->cont = ctx;
+ (*res_handle)->load_error = APR_SUCCESS;
return APR_SUCCESS;
}
@@ -94,7 +97,7 @@ ap_status_t ap_dso_sym(ap_dso_handle_sym_t *ressym,
return APR_SUCCESS;
}
-char *ap_dso_error(char *buf, int bufsize, ap_status_t errcode)
+char *ap_dso_error(ap_dso_handle_t *dso, char *buf, ap_size_t bufsize)
{
- return "An error occured loading a DLL.";
+ return ap_strerror(dso->load_error, buf, bufsize);
}
diff --git a/dso/win32/dso.h b/dso/win32/dso.h
index 745db192d..d4e0df905 100644
--- a/dso/win32/dso.h
+++ b/dso/win32/dso.h
@@ -63,6 +63,7 @@
struct ap_dso_handle_t {
ap_pool_t *cont;
void *handle;
+ ap_status_t load_error;
};
#endif