urlmon: Create a message window for each binding to make sure they are cleaned up properly.

This commit is contained in:
Alexandre Julliard 2006-10-16 11:32:17 +02:00
parent 0b20150531
commit d3d3aba3a3
3 changed files with 5 additions and 15 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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 */