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

This commit is contained in:
Alexandre Julliard 2013-04-30 17:25:29 +02:00
parent 2710f05cef
commit 21bfa0812e
1 changed files with 9 additions and 23 deletions

View File

@ -465,39 +465,25 @@ static void ODBC_ReplicateToRegistry (void)
/***********************************************************************
* 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 fdwReason, LPVOID lpvReserved)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
{
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);
if (ODBC_LoadDriverManager())
{
ODBC_LoadDMFunctions();
ODBC_ReplicateToRegistry();
}
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
TRACE("Unloading ODBC...\n");
if (dmHandle)
{
wine_dlclose(dmHandle,NULL,0);
dmHandle = NULL;
}
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
if (dmHandle) wine_dlclose(dmHandle,NULL,0);
}
return TRUE;