Alexandre Julliard : explorerframe: Convert dll registration to the IRegistrar mechanism.

Alexandre Julliard julliard at winehq.org
Fri Dec 10 11:57:00 CST 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec 10 15:02:43 2010 +0100

explorerframe: Convert dll registration to the IRegistrar mechanism.

---

 dlls/explorerframe/Makefile.in                     |    3 +-
 .../explorerframe/{eframe.rc => explorerframe.idl} |   12 +++-
 dlls/explorerframe/explorerframe.inf               |   17 -----
 dlls/explorerframe/explorerframe_main.c            |   67 +-------------------
 4 files changed, 13 insertions(+), 86 deletions(-)

diff --git a/dlls/explorerframe/Makefile.in b/dlls/explorerframe/Makefile.in
index af92758..975f197 100644
--- a/dlls/explorerframe/Makefile.in
+++ b/dlls/explorerframe/Makefile.in
@@ -6,8 +6,9 @@ C_SRCS = \
 	explorerframe_main.c \
 	nstc.c
 
+IDL_R_SRCS = explorerframe.idl
+
 RC_SRCS = \
-	eframe.rc \
 	version.rc
 
 @MAKE_DLL_RULES@
diff --git a/dlls/explorerframe/eframe.rc b/dlls/explorerframe/explorerframe.idl
similarity index 74%
rename from dlls/explorerframe/eframe.rc
rename to dlls/explorerframe/explorerframe.idl
index 25619de..8171396 100644
--- a/dlls/explorerframe/eframe.rc
+++ b/dlls/explorerframe/explorerframe.idl
@@ -1,7 +1,7 @@
 /*
- * ExplorerFrame main resource file
+ * COM Classes for explorerframe
  *
- * Copyright 2010 David Hedberg
+ * Copyright 2010 Alexandre Julliard
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,5 +18,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-/* @makedep: explorerframe.inf */
-REGINST REGINST explorerframe.inf
+[
+    helpstring("Shell Name Space ListView"),
+    threading(apartment),
+    uuid(ae054212-3535-4430-83ed-d501aa6680e6)
+]
+coclass NamespaceTreeControl { interface INameSpaceTreeControl2; }
diff --git a/dlls/explorerframe/explorerframe.inf b/dlls/explorerframe/explorerframe.inf
deleted file mode 100644
index 7d6ba63..0000000
--- a/dlls/explorerframe/explorerframe.inf
+++ /dev/null
@@ -1,17 +0,0 @@
-[version]
-Signature="$CHICAGO$"
-
-[RegisterDll]
-AddReg=Classes.Reg
-
-[UnregisterDll]
-DelReg=Classes.Reg
-
-[Classes.Reg]
-; For some reason called "ListView" in the registry.
-HKCR,"CLSID\%CLSID_NamespaceTreeControl%",,,"Shell Name Space ListView"
-HKCR,"CLSID\%CLSID_NamespaceTreeControl%\InProcServer32",,,"%MODULE%"
-HKCR,"CLSID\%CLSID_NamespaceTreeControl%\InProcServer32","ThreadingModel",,"Apartment"
-
-[Strings]
-MODULE="explorerframe.dll"
diff --git a/dlls/explorerframe/explorerframe_main.c b/dlls/explorerframe/explorerframe_main.c
index cc535e7..365898f 100644
--- a/dlls/explorerframe/explorerframe_main.c
+++ b/dlls/explorerframe/explorerframe_main.c
@@ -30,8 +30,8 @@
 #include "winuser.h"
 #include "winreg.h"
 #include "shlwapi.h"
-#include "advpub.h"
 #include "shobjidl.h"
+#include "rpcproxy.h"
 
 #include "wine/debug.h"
 
@@ -209,72 +209,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
 }
 
 /*************************************************************************
- *          Register/Unregister DLL, based on shdocvw/factory.c
- */
-static HRESULT reg_install(LPCSTR section, const STRTABLEA *strtable)
-{
-    HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
-    HMODULE hadvpack;
-    HRESULT hres;
-
-    static const WCHAR advpackW[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
-
-    hadvpack = LoadLibraryW(advpackW);
-    pRegInstall = (void *)GetProcAddress(hadvpack, "RegInstall");
-
-    hres = pRegInstall(explorerframe_hinstance, section, strtable);
-
-    FreeLibrary(hadvpack);
-    return hres;
-}
-
-#define INF_SET_CLSID(clsid)                  \
-    do                                        \
-    {                                         \
-        static CHAR name[] = "CLSID_" #clsid; \
-                                              \
-        pse[i].pszName = name;                \
-        clsids[i++] = &CLSID_ ## clsid;       \
-    } while (0)
-
-static HRESULT register_server(BOOL doregister)
-{
-    STRTABLEA strtable;
-    STRENTRYA pse[1];
-    static CLSID const *clsids[1];
-    unsigned int i = 0;
-    HRESULT hres;
-
-    INF_SET_CLSID(NamespaceTreeControl);
-
-    for(i = 0; i < sizeof(pse)/sizeof(pse[0]); i++)
-    {
-        pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39);
-        sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
-                clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
-                clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
-                clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
-    }
-
-    strtable.cEntries = sizeof(pse)/sizeof(pse[0]);
-    strtable.pse = pse;
-
-    hres = reg_install(doregister ? "RegisterDll" : "UnregisterDll", &strtable);
-
-    for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
-        HeapFree(GetProcessHeap(), 0, pse[i].pszValue);
-
-    return hres;
-}
-
-#undef INF_SET_CLSID
-
-/*************************************************************************
  *          DllRegisterServer (ExplorerFrame.@)
  */
 HRESULT WINAPI DllRegisterServer(void)
 {
-    return register_server(TRUE);
+    return __wine_register_resources( explorerframe_hinstance, NULL );
 }
 
 /*************************************************************************
@@ -282,5 +221,5 @@ HRESULT WINAPI DllRegisterServer(void)
  */
 HRESULT WINAPI DllUnregisterServer(void)
 {
-    return register_server(FALSE);
+    return __wine_unregister_resources( explorerframe_hinstance, NULL );
 }




More information about the wine-cvs mailing list