Alexandre Julliard : urlmon: Forward the DllMain call to the dlldata. c generated function.

Alexandre Julliard julliard at winehq.org
Fri Apr 9 11:49:54 CDT 2010


Module: wine
Branch: master
Commit: 5c632145e84a9dfc4f7ff6f2ff7fa5a05a512fc9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5c632145e84a9dfc4f7ff6f2ff7fa5a05a512fc9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr  8 19:24:04 2010 +0200

urlmon: Forward the DllMain call to the dlldata.c generated function.

---

 dlls/urlmon/bindprot.c    |    4 ++--
 dlls/urlmon/regsvr.c      |    2 +-
 dlls/urlmon/urlmon_main.c |    4 ++--
 dlls/urlmon/urlmon_main.h |    3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c
index 07d6fc2..29b8532 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 9e27825..6e417ac 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 272884e..edaad42 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 8db786b..071af8d 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;




More information about the wine-cvs mailing list