diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-10-06 17:24:41 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-10-06 17:24:41 +0000 |
commit | 6378a281a5e8c002a97bde6208e879e8c921c747 (patch) | |
tree | 1bb6f5080b75482c802151d16e1f580d47313e14 /dso | |
parent | 6e116dc381a124f517ac0316bd2d5939434cf271 (diff) | |
download | libapr-6378a281a5e8c002a97bde6208e879e8c921c747.tar.gz |
Here it is, the Win32 part of the big canonical errors patch.
The reason is really, really simple. If we ever choose to mix clib and
dos error codes, they criss-cross and don't line up, but they share the
same number space. As I wrote the new APR_IS_ERROR macros, I realized
we were about to shoot ourselves in the foot.
These changes nearly entirely affect Win32 only. The next big patch will
affect all of the rv == APR_ENOENT type problems throughout the system.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60553 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso')
-rw-r--r-- | dso/win32/dso.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 732e86fc9..98277815f 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,11 +59,13 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { + /* XXX: Must convert path from / to \ notation + */ HINSTANCE os_handle = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); if(os_handle == NULL) { - (*res_handle)->load_error = GetLastError(); + (*res_handle)->load_error = apr_get_os_error(); return (*res_handle)->load_error; } @@ -76,18 +78,18 @@ apr_status_t apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path apr_status_t apr_dso_unload(struct apr_dso_handle_t *handle) { if (!FreeLibrary(handle->handle)) { - return GetLastError(); + return apr_get_os_error(); } return APR_SUCCESS; } apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, - struct apr_dso_handle_t *handle, - const char *symname) + struct apr_dso_handle_t *handle, + const char *symname) { FARPROC retval = GetProcAddress(handle->handle, symname); if (!retval) { - return GetLastError(); + return apr_get_os_error(); } *ressym = retval; |