Mike McCormack : shdocvw: Register iexplore.exe as a COM local server.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 12 04:52:06 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 42c7372b6b8c64b8f6e9ea378c283d0903988bfd
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=42c7372b6b8c64b8f6e9ea378c283d0903988bfd

Author: Mike McCormack <mike at codeweavers.com>
Date:   Tue Apr 11 21:38:14 2006 +0900

shdocvw: Register iexplore.exe as a COM local server.

---

 dlls/shdocvw/Makefile.in |    2 +-
 dlls/shdocvw/regsvr.c    |   52 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/dlls/shdocvw/Makefile.in b/dlls/shdocvw/Makefile.in
index b18eff9..c9c394b 100644
--- a/dlls/shdocvw/Makefile.in
+++ b/dlls/shdocvw/Makefile.in
@@ -5,7 +5,7 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = shdocvw.dll
 IMPORTLIB = libshdocvw.$(IMPLIBEXT)
-IMPORTS   = shlwapi user32 advapi32 kernel32
+IMPORTS   = shell32 shlwapi user32 advapi32 kernel32
 DELAYIMPORTS = urlmon ole32 oleaut32
 EXTRALIBS = -luuid
 
diff --git a/dlls/shdocvw/regsvr.c b/dlls/shdocvw/regsvr.c
index 5c282df..8b8d23d 100644
--- a/dlls/shdocvw/regsvr.c
+++ b/dlls/shdocvw/regsvr.c
@@ -102,6 +102,11 @@ static WCHAR const viprogid_keyname[25] 
     'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
     0 };
 static char const tmodel_valuename[] = "ThreadingModel";
+static WCHAR const lcs32_keyname[] = {
+    'L','o','c','a','l','S','e','r','v','e','r','3','2',0 };
+static const WCHAR szIERelPath[] = {
+    'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','\\',
+    'i','e','x','p','l','o','r','e','.','e','x','e',0 };
 
 /***********************************************************************
  *		static helper functions
@@ -509,6 +514,14 @@ static struct regsvr_coclass const cocla
 	"Shell.Explorer.2",
 	"Shell.Explorer"
     },
+    {   &CLSID_InternetExplorer,
+        "Internet Explorer(Ver 1.0)",
+        NULL,
+        NULL,
+        NULL,
+        "InternetExplorer.Application.1",
+        "InternetExplorer.Application"
+    },
     { NULL }			/* list terminator */
 };
 
@@ -520,6 +533,43 @@ static struct regsvr_interface const int
     { NULL }			/* list terminator */
 };
 
+static HRESULT register_localserver(void)
+{
+    HKEY coclass_key = 0, clsid_key = 0;
+    WCHAR buf[39], path[MAX_PATH];
+    LONG res;
+    UINT len;
+
+    res = SHGetFolderPathW(NULL, CSIDL_FLAG_CREATE|CSIDL_PROGRAM_FILES,
+                           NULL, SHGFP_TYPE_CURRENT, path);
+    if (FAILED(res))
+        return res;
+
+    len = lstrlenW(path);
+    if ((len + (sizeof szIERelPath/sizeof(WCHAR)) + 1) > MAX_PATH)
+        return E_FAIL;
+
+    path[len] = '\\';
+    lstrcpyW(&path[len+1], szIERelPath);
+
+    res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
+			  KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
+    if (res != ERROR_SUCCESS) goto err;
+
+    StringFromGUID2(&CLSID_InternetExplorer, buf, 39);
+    res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
+                          KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
+    if (res != ERROR_SUCCESS) goto err;
+
+    res = register_key_defvalueW(clsid_key, lcs32_keyname, path);
+    if (res != ERROR_SUCCESS) goto err;
+
+err:
+    if (clsid_key) RegCloseKey(clsid_key);
+    if (coclass_key) RegCloseKey(coclass_key);
+    return (res == ERROR_SUCCESS) ? S_OK : E_FAIL;
+}
+
 /***********************************************************************
  *		DllRegisterServer (SHDOCVW.@)
  */
@@ -532,6 +582,8 @@ HRESULT WINAPI DllRegisterServer(void)
     hr = register_coclasses(coclass_list);
     if (SUCCEEDED(hr))
 	hr = register_interfaces(interface_list);
+    if (SUCCEEDED(hr))
+        hr = register_localserver();
     return hr;
 }
 




More information about the wine-cvs mailing list