diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c index 07d6fc2f525..29b8532b13d 100644 --- a/dlls/urlmon/bindprot.c +++ b/dlls/urlmon/bindprot.c @@ -155,7 +155,7 @@ HWND get_notif_hwnd(void) NULL }; - wndclass.hInstance = URLMON_hInstance; + wndclass.hInstance = hProxyDll; wnd_class = RegisterClassExW(&wndclass); if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS) @@ -164,7 +164,7 @@ HWND get_notif_hwnd(void) tls_data->notif_hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow, wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE, - NULL, URLMON_hInstance, NULL); + NULL, hProxyDll, NULL); if(tls_data->notif_hwnd) tls_data->notif_hwnd_cnt++; diff --git a/dlls/urlmon/regsvr.c b/dlls/urlmon/regsvr.c index 9e278259e37..6e417ac9607 100644 --- a/dlls/urlmon/regsvr.c +++ b/dlls/urlmon/regsvr.c @@ -560,7 +560,7 @@ static HRESULT register_inf(BOOL doregister) hAdvpack = LoadLibraryW(wszAdvpack); pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); - hres = pRegInstall(URLMON_hInstance, doregister ? "RegisterDll" : "UnregisterDll", &strtable); + hres = pRegInstall(hProxyDll, doregister ? "RegisterDll" : "UnregisterDll", &strtable); for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) heap_free(pse[i].pszValue); diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index 272884eb2a6..edaad42289f 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -34,7 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); LONG URLMON_refCount = 0; -HINSTANCE URLMON_hInstance = 0; static HMODULE hCabinet = NULL; static DWORD urlmon_tls = TLS_OUT_OF_INDEXES; @@ -144,9 +143,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad); + URLMON_DllMain( hinstDLL, fdwReason, fImpLoad ); + switch(fdwReason) { case DLL_PROCESS_ATTACH: - URLMON_hInstance = hinstDLL; init_session(TRUE); break; diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 8db786b7d80..071af8dd73e 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -36,7 +36,7 @@ #include "wine/unicode.h" #include "wine/list.h" -extern HINSTANCE URLMON_hInstance; +extern HINSTANCE hProxyDll DECLSPEC_HIDDEN; extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT StdURLMoniker_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); @@ -48,6 +48,7 @@ extern HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); +extern BOOL WINAPI URLMON_DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllRegisterServer(void) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllUnregisterServer(void) DECLSPEC_HIDDEN;