static int win32_unload(DSO *dso) { HINSTANCE *p; if (dso == NULL) { DSOerr(DSO_F_WIN32_UNLOAD, ERR_R_PASSED_NULL_PARAMETER); return (0); } if (sk_void_num(dso->meth_data) < 1) return (1); p = sk_void_pop(dso->meth_data); if (p == NULL) { DSOerr(DSO_F_WIN32_UNLOAD, DSO_R_NULL_HANDLE); return (0); } if (!FreeLibrary(*p)) { DSOerr(DSO_F_WIN32_UNLOAD, DSO_R_UNLOAD_FAILED); /* * We should push the value back onto the stack in case of a retry. */ sk_void_push(dso->meth_data, p); return (0); } /* Cleanup */ OPENSSL_free(p); return (1); }
static int dlfcn_unload(DSO *dso) { return 0; #if 0 void *ptr; if (dso == NULL) { DSOerr(DSO_F_DLFCN_UNLOAD, ERR_R_PASSED_NULL_PARAMETER); return (0); } if (sk_void_num(dso->meth_data) < 1) return (1); ptr = sk_void_pop(dso->meth_data); if (ptr == NULL) { DSOerr(DSO_F_DLFCN_UNLOAD, DSO_R_NULL_HANDLE); /* * Should push the value back onto the stack in case of a retry. */ sk_void_push(dso->meth_data, ptr); return (0); } /* For now I'm not aware of any errors associated with dlclose() */ dlclose(ptr); return (1); #endif }
/* * Note that this doesn't actually unload the shared image, as there is no * such thing in VMS. Next time it get loaded again, a new copy will * actually be loaded. */ static int vms_unload(DSO *dso) { DSO_VMS_INTERNAL *p; if (dso == NULL) { DSOerr(DSO_F_VMS_UNLOAD, ERR_R_PASSED_NULL_PARAMETER); return (0); } if (sk_void_num(dso->meth_data) < 1) return (1); p = (DSO_VMS_INTERNAL *)sk_void_pop(dso->meth_data); if (p == NULL) { DSOerr(DSO_F_VMS_UNLOAD, DSO_R_NULL_HANDLE); return (0); } /* Cleanup */ OPENSSL_free(p); return (1); }