ole32: Don't try to unregister window class if it was never registered.
UnregisterClass may load display driver, which is may be problematic inside DLL_PROCESS_DETACH (esp. in Android drivers, which imports ole32 itself). Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7c57461d29
commit
fd67e394e6
|
@ -479,6 +479,8 @@ struct apartment_loaded_dll
|
||||||
|
|
||||||
static const WCHAR wszAptWinClass[] = {'O','l','e','M','a','i','n','T','h','r','e','a','d','W','n','d','C','l','a','s','s',0};
|
static const WCHAR wszAptWinClass[] = {'O','l','e','M','a','i','n','T','h','r','e','a','d','W','n','d','C','l','a','s','s',0};
|
||||||
|
|
||||||
|
static ATOM apt_win_class;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* This section contains OpenDllList implementation
|
* This section contains OpenDllList implementation
|
||||||
*/
|
*/
|
||||||
|
@ -1695,7 +1697,7 @@ static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context
|
||||||
wclass.lpfnWndProc = apartment_wndproc;
|
wclass.lpfnWndProc = apartment_wndproc;
|
||||||
wclass.hInstance = hProxyDll;
|
wclass.hInstance = hProxyDll;
|
||||||
wclass.lpszClassName = wszAptWinClass;
|
wclass.lpszClassName = wszAptWinClass;
|
||||||
RegisterClassW(&wclass);
|
apt_win_class = RegisterClassW(&wclass);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5270,7 +5272,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved)
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
if (reserved) break;
|
if (reserved) break;
|
||||||
release_std_git();
|
release_std_git();
|
||||||
UnregisterClassW( wszAptWinClass, hProxyDll );
|
if(apt_win_class)
|
||||||
|
UnregisterClassW( (const WCHAR*)MAKEINTATOM(apt_win_class), hProxyDll );
|
||||||
RPC_UnregisterAllChannelHooks();
|
RPC_UnregisterAllChannelHooks();
|
||||||
COMPOBJ_DllList_Free();
|
COMPOBJ_DllList_Free();
|
||||||
DeleteCriticalSection(&csRegisteredClassList);
|
DeleteCriticalSection(&csRegisteredClassList);
|
||||||
|
|
Loading…
Reference in New Issue