diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index 84e41864569..d2b3ca907c0 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -250,19 +250,13 @@ static HWND get_notif_hwnd(void) wndclass.hInstance = URLMON_hInstance; wnd_class = RegisterClassExW(&wndclass); + if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS) + wnd_class = 1; } - if(!urlmon_tls) - urlmon_tls = TlsAlloc(); - - hwnd = TlsGetValue(urlmon_tls); - if(hwnd) - return hwnd; - - hwnd = CreateWindowExW(0, MAKEINTATOMW(wnd_class), + hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow, wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, URLMON_hInstance, NULL); - TlsSetValue(urlmon_tls, hwnd); TRACE("hwnd = %p\n", hwnd); @@ -691,6 +685,8 @@ static ULONG WINAPI Binding_Release(IBinding *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { + if (This->notif_hwnd) + DestroyWindow( This->notif_hwnd ); if(This->callback) IBindStatusCallback_Release(This->callback); if(This->protocol) diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index f7e281eac6d..b0838717ede 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -43,8 +43,6 @@ LONG URLMON_refCount = 0; HINSTANCE URLMON_hInstance = 0; static HMODULE hCabinet = NULL; -DWORD urlmon_tls = 0; - static void init_session(BOOL); /*********************************************************************** @@ -62,8 +60,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) break; case DLL_PROCESS_DETACH: - if(urlmon_tls) - TlsFree(urlmon_tls); if (hCabinet) FreeLibrary(hCabinet); hCabinet = NULL; diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 240fdfe544b..4e6e2140e74 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -59,6 +59,4 @@ HRESULT get_protocol_handler(LPCWSTR url, IClassFactory **ret); HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv); -extern DWORD urlmon_tls; - #endif /* __WINE_URLMON_MAIN_H */