Commit 21bfa081 authored by Alexandre Julliard's avatar Alexandre Julliard

odbc32: Don't unload external libraries on process shutdown.

parent 2710f05c
...@@ -465,39 +465,25 @@ static void ODBC_ReplicateToRegistry (void) ...@@ -465,39 +465,25 @@ static void ODBC_ReplicateToRegistry (void)
/*********************************************************************** /***********************************************************************
* DllMain [Internal] Initializes the internal 'ODBC32.DLL'. * DllMain [Internal] Initializes the internal 'ODBC32.DLL'.
*
* PARAMS
* hinstDLL [I] handle to the DLL's instance
* fdwReason [I]
* lpvReserved [I] reserved, must be NULL
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/ */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
TRACE("Initializing or Finalizing proxy ODBC: %p,%x,%p\n", hinstDLL, fdwReason, lpvReserved); TRACE("proxy ODBC: %p,%x,%p\n", hinstDLL, reason, reserved);
if (fdwReason == DLL_PROCESS_ATTACH) switch (reason)
{ {
TRACE("Loading ODBC...\n"); case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
if (ODBC_LoadDriverManager()) if (ODBC_LoadDriverManager())
{ {
ODBC_LoadDMFunctions(); ODBC_LoadDMFunctions();
ODBC_ReplicateToRegistry(); ODBC_ReplicateToRegistry();
} }
} break;
else if (fdwReason == DLL_PROCESS_DETACH)
{ case DLL_PROCESS_DETACH:
TRACE("Unloading ODBC...\n"); if (reserved) break;
if (dmHandle) if (dmHandle) wine_dlclose(dmHandle,NULL,0);
{
wine_dlclose(dmHandle,NULL,0);
dmHandle = NULL;
}
} }
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment