[ros-diffs] [cwittich] 45915: [ATL] sync atl to wine 1.1.40

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sat Mar 6 12:14:01 CET 2010


Author: cwittich
Date: Sat Mar  6 12:14:00 2010
New Revision: 45915

URL: http://svn.reactos.org/svn/reactos?rev=45915&view=rev
Log:
[ATL]
sync atl to wine 1.1.40

Modified:
    trunk/reactos/dll/win32/atl/registrar.c

Modified: trunk/reactos/dll/win32/atl/registrar.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/registrar.c?rev=45915&r1=45914&r2=45915&view=diff
==============================================================================
--- trunk/reactos/dll/win32/atl/registrar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/atl/registrar.c [iso-8859-1] Sat Mar  6 12:14:00 2010
@@ -758,39 +758,44 @@
                                       LPCOLESTR wszId, BOOL do_register,
                                       const struct _ATL_REGMAP_ENTRY* pMapEntries)
 {
-    WCHAR buf[MAX_PATH];
+    IRegistrar *registrar;
     HRESULT hres;
     const struct _ATL_REGMAP_ENTRY *pMapEntry;
 
     static const WCHAR wszModule[] = {'M','O','D','U','L','E',0};
     static const WCHAR wszRegistry[] = {'R','E','G','I','S','T','R','Y',0};
-    static const WCHAR wszCLSID_ATLRegistrar[] =
+
+    if (pRegistrar)
+        registrar = pRegistrar;
+    else
+        Registrar_create(NULL, &IID_IRegistrar, (void**)&registrar);
+
+    IRegistrar_AddReplacement(registrar, wszModule, wszDll);
+
+    for (pMapEntry = pMapEntries; pMapEntry && pMapEntry->szKey; pMapEntry++)
+        IRegistrar_AddReplacement(registrar, pMapEntry->szKey, pMapEntry->szData);
+
+    if(do_register)
+        hres = IRegistrar_ResourceRegisterSz(registrar, wszDll, wszId, wszRegistry);
+    else
+        hres = IRegistrar_ResourceUnregisterSz(registrar, wszDll, wszId, wszRegistry);
+
+    if(registrar != pRegistrar)
+        IRegistrar_Release(registrar);
+    return hres;
+}
+
+static HRESULT do_register_server(BOOL do_register)
+{
+    static const WCHAR CLSID_ATLRegistrarW[] =
             {'C','L','S','I','D','_','A','T','L','R','e','g','i','s','t','r','a','r',0};
-
-    if (!pRegistrar)
-        Registrar_create(NULL, &IID_IRegistrar, (void**)&pRegistrar);
-
-    IRegistrar_AddReplacement(pRegistrar, wszModule, wszDll);
-
-    for (pMapEntry = pMapEntries; pMapEntry && pMapEntry->szKey; pMapEntry++)
-        IRegistrar_AddReplacement(pRegistrar, pMapEntry->szKey, pMapEntry->szData);
-
-    StringFromGUID2(&CLSID_ATLRegistrar, buf, sizeof(buf)/sizeof(buf[0]));
-    IRegistrar_AddReplacement(pRegistrar, wszCLSID_ATLRegistrar, buf);
-
-    if(do_register)
-        hres = IRegistrar_ResourceRegisterSz(pRegistrar, wszDll, wszId, wszRegistry);
-    else
-        hres = IRegistrar_ResourceUnregisterSz(pRegistrar, wszDll, wszId, wszRegistry);
-
-    IRegistrar_Release(pRegistrar);
-    return hres;
-}
-
-static HRESULT do_register_server(BOOL do_register)
-{
-    static const WCHAR wszDll[] = {'a','t','l','.','d','l','l',0};
-    return do_register_dll_server(NULL, wszDll, MAKEINTRESOURCEW(101), do_register, NULL);
+    static const WCHAR atl_dllW[] = {'a','t','l','.','d','l','l',0};
+
+    WCHAR clsid_str[40];
+    const struct _ATL_REGMAP_ENTRY reg_map[] = {{CLSID_ATLRegistrarW, clsid_str}, {NULL,NULL}};
+
+    StringFromGUID2(&CLSID_ATLRegistrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR));
+    return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
 }
 
 /***********************************************************************




More information about the Ros-diffs mailing list