pdh: Delete the static critical section when unloading the dll.

This commit is contained in:
Francois Gouget 2011-11-17 09:53:39 +01:00 committed by Alexandre Julliard
parent 7f3fa7c858
commit fcd8a8f447
1 changed files with 9 additions and 5 deletions

View File

@ -85,12 +85,16 @@ static inline WCHAR *pdh_strdup_aw( const char *src )
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(0x%p, %d, %p)\n",hinstDLL,fdwReason,lpvReserved);
if (fdwReason == DLL_WINE_PREATTACH) return FALSE; /* prefer native version */
if (fdwReason == DLL_PROCESS_ATTACH)
switch (fdwReason)
{
DisableThreadLibraryCalls( hinstDLL );
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
break;
case DLL_PROCESS_DETACH:
DeleteCriticalSection(&pdh_handle_cs);
break;
}
return TRUE;