Aric Stewart : shdocvw: Do not do our iexplore. exe registration if native Internet Explorer is detected to be present.

Alexandre Julliard julliard at winehq.org
Fri May 9 06:27:00 CDT 2008


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu May  8 11:26:47 2008 -0500

shdocvw: Do not do our iexplore.exe registration if native Internet Explorer is detected to be present.

---

 dlls/shdocvw/Makefile.in |    2 +-
 dlls/shdocvw/factory.c   |   35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/dlls/shdocvw/Makefile.in b/dlls/shdocvw/Makefile.in
index e4f573a..e254078 100644
--- a/dlls/shdocvw/Makefile.in
+++ b/dlls/shdocvw/Makefile.in
@@ -6,7 +6,7 @@ VPATH     = @srcdir@
 MODULE    = shdocvw.dll
 IMPORTLIB = shdocvw
 IMPORTS   = uuid shell32 shlwapi user32 advapi32 kernel32
-DELAYIMPORTS = urlmon ole32 oleaut32
+DELAYIMPORTS = version urlmon ole32 oleaut32
 
 C_SRCS = \
 	classinfo.c \
diff --git a/dlls/shdocvw/factory.c b/dlls/shdocvw/factory.c
index 3a4ba9f..69cbaa3 100644
--- a/dlls/shdocvw/factory.c
+++ b/dlls/shdocvw/factory.c
@@ -26,6 +26,8 @@
 #include "advpub.h"
 #include "isguids.h"
 
+#include "winver.h"
+
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
@@ -287,8 +289,39 @@ HRESULT WINAPI DllUnregisterServer(void)
     return UnRegisterTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, SYS_WIN32);
 }
 
+static BOOL check_native_ie(void)
+{
+    static const WCHAR cszPath[] = {'b','r','o','w','s','e','u','i','.','d','l','l',0};
+    DWORD handle,size;
+
+    size = GetFileVersionInfoSizeW(cszPath,&handle);
+    if (size)
+    {
+        LPVOID buf;
+        LPWSTR lpFileDescription;
+        UINT dwBytes;
+        static const WCHAR cszFD[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\','0','4','0','9','0','4','e','4','\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0};
+        static const WCHAR cszWine[] = {'W','i','n','e',0};
+
+        buf = HeapAlloc(GetProcessHeap(),0,size);
+        GetFileVersionInfoW(cszPath,0,size,buf);
+
+        if (VerQueryValueW(buf, cszFD, (LPVOID*)&lpFileDescription, &dwBytes) &&
+            strstrW(lpFileDescription,cszWine))
+                return FALSE;
+    }
+
+    return TRUE;
+}
+
 DWORD register_iexplore(BOOL doregister)
 {
-    HRESULT hres = reg_install(doregister ? "RegisterIE" : "UnregisterIE", NULL);
+    HRESULT hres;
+    if (check_native_ie())
+    {
+        TRACE("Native IE detected, not doing registration\n");
+        return S_OK;
+    }
+    hres = reg_install(doregister ? "RegisterIE" : "UnregisterIE", NULL);
     return !SUCCEEDED(hres);
 }




More information about the wine-cvs mailing list