wininet: Unload OpenSSL when unloading wininet.

This commit is contained in:
Juan Lang 2009-10-02 07:43:45 -07:00 committed by Alexandre Julliard
parent 23842df371
commit 41592569fd
3 changed files with 19 additions and 0 deletions

View file

@ -290,6 +290,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_DETACH:
NETCON_unload();
URLCacheContainers_DeleteAll();
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)

View file

@ -429,6 +429,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
void NETCON_unload(void);
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol);
BOOL NETCON_close(WININET_NETCONNECTION *connection);

View file

@ -120,6 +120,7 @@ static SSL_CTX *ctx;
MAKE_FUNCPTR(SSL_library_init);
MAKE_FUNCPTR(SSL_load_error_strings);
MAKE_FUNCPTR(SSLv23_method);
MAKE_FUNCPTR(SSL_CTX_free);
MAKE_FUNCPTR(SSL_CTX_new);
MAKE_FUNCPTR(SSL_new);
MAKE_FUNCPTR(SSL_free);
@ -191,6 +192,7 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
DYNSSL(SSL_library_init);
DYNSSL(SSL_load_error_strings);
DYNSSL(SSLv23_method);
DYNSSL(SSL_CTX_free);
DYNSSL(SSL_CTX_new);
DYNSSL(SSL_new);
DYNSSL(SSL_free);
@ -246,6 +248,20 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
return TRUE;
}
void NETCON_unload(void)
{
#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
if (OpenSSL_crypto_handle)
wine_dlclose(OpenSSL_crypto_handle, NULL, 0);
if (OpenSSL_ssl_handle)
{
if (ctx)
pSSL_CTX_free(ctx);
wine_dlclose(OpenSSL_ssl_handle, NULL, 0);
}
#endif
}
BOOL NETCON_connected(WININET_NETCONNECTION *connection)
{
if (connection->socketFD == -1)