Lines 41-62
Link Here
|
41 |
|
41 |
|
42 |
APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) |
42 |
APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) |
43 |
{ |
43 |
{ |
|
|
44 |
|
44 |
char failed_module[200]; |
45 |
char failed_module[200]; |
45 |
HMODULE handle; |
46 |
HMODULE handle; |
46 |
int rc; |
47 |
int rc; |
47 |
|
|
|
48 |
*res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); |
48 |
*res_handle = apr_pcalloc(ctx, sizeof(**res_handle)); |
49 |
(*res_handle)->cont = ctx; |
49 |
(*res_handle)->cont = ctx; |
50 |
(*res_handle)->load_error = APR_SUCCESS; |
50 |
(*res_handle)->load_error = APR_SUCCESS; |
51 |
(*res_handle)->failed_module = NULL; |
51 |
(*res_handle)->failed_module = NULL; |
52 |
|
52 |
|
53 |
if ((rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle)) != 0) { |
53 |
rc = DosLoadModule(failed_module, sizeof(failed_module), path, &handle); |
|
|
54 |
|
55 |
if ((rc != 0)&&(rc!=87)) { |
54 |
(*res_handle)->load_error = APR_FROM_OS_ERROR(rc); |
56 |
(*res_handle)->load_error = APR_FROM_OS_ERROR(rc); |
55 |
(*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); |
57 |
(*res_handle)->failed_module = apr_pstrdup(ctx, failed_module); |
56 |
return APR_FROM_OS_ERROR(rc); |
58 |
return APR_FROM_OS_ERROR(rc); |
57 |
} |
59 |
} |
58 |
|
60 |
|
59 |
(*res_handle)->handle = handle; |
61 |
|
|
|
62 |
if (rc==87){ |
63 |
int rc2; |
64 |
HMODULE handle2; |
65 |
rc2=DosQueryModuleHandle(path,&handle2); |
66 |
(*res_handle)->handle = handle2; |
67 |
} |
68 |
if (rc==0) { |
69 |
(*res_handle)->handle = handle;} |
60 |
apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); |
70 |
apr_pool_cleanup_register(ctx, *res_handle, dso_cleanup, apr_pool_cleanup_null); |
61 |
return APR_SUCCESS; |
71 |
return APR_SUCCESS; |
62 |
} |
72 |
} |
Lines 76-86
Link Here
|
76 |
{ |
87 |
{ |
77 |
PFN func; |
88 |
PFN func; |
78 |
int rc; |
89 |
int rc; |
79 |
|
|
|
80 |
if (symname == NULL || ressym == NULL) |
90 |
if (symname == NULL || ressym == NULL) |
81 |
return APR_ESYMNOTFOUND; |
91 |
return APR_ESYMNOTFOUND; |
82 |
|
92 |
|
83 |
if ((rc = DosQueryProcAddr(handle->handle, 0, symname, &func)) != 0) { |
93 |
|
|
|
94 |
#if defined(__INNOTEK_LIBC__) |
95 |
void *retval; |
96 |
char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2)); |
97 |
sprintf(symbol, "_%s", symname); |
98 |
rc = DosQueryProcAddr(handle->handle, 0, symbol, &func); |
99 |
free(symbol); |
100 |
#else |
101 |
rc = DosQueryProcAddr(handle->handle, 0, symname, &func); |
102 |
#endif |
103 |
if (rc != 0) { |
84 |
handle->load_error = APR_FROM_OS_ERROR(rc); |
104 |
handle->load_error = APR_FROM_OS_ERROR(rc); |
85 |
return handle->load_error; |
105 |
return handle->load_error; |
86 |
} |
106 |
} |