2013-09-14 18:22:37 +00:00
|
|
|
diff -prudN e:\Wine\dlls\atl/atl_main.c e:\reactos\dll\win32\atl/atl_main.c
|
|
|
|
--- e:\Wine\dlls\atl/atl_main.c 2013-09-03 23:09:36.308717300 +0100
|
|
|
|
+++ e:\reactos\dll\win32\atl/atl_main.c 2013-09-12 12:15:17.112785700 +0100
|
|
|
|
@@ -547,6 +555,53 @@ static const IClassFactoryVtbl IRegistra
|
2010-07-26 09:13:50 +00:00
|
|
|
|
2013-09-14 18:22:37 +00:00
|
|
|
static IClassFactory RegistrarCF = { &IRegistrarCFVtbl };
|
2012-03-15 20:17:15 +00:00
|
|
|
|
2013-09-14 18:22:37 +00:00
|
|
|
+static HRESULT do_register_dll_server(IRegistrar *pRegistrar, LPCOLESTR wszDll,
|
|
|
|
+ LPCOLESTR wszId, BOOL do_register,
|
|
|
|
+ const struct _ATL_REGMAP_ENTRY* pMapEntries)
|
|
|
|
+{
|
|
|
|
+ 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};
|
|
|
|
+
|
|
|
|
+ if(pRegistrar) {
|
|
|
|
+ registrar = pRegistrar;
|
|
|
|
+ }else {
|
|
|
|
+ hres = AtlCreateRegistrar(®istrar);
|
|
|
|
+ if(FAILED(hres))
|
|
|
|
+ return hres;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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;
|
|
|
|
+}
|
|
|
|
+
|
2012-03-15 20:17:15 +00:00
|
|
|
+static HRESULT do_register_server(BOOL do_register)
|
|
|
|
+{
|
|
|
|
+ static const WCHAR CLSID_RegistrarW[] =
|
|
|
|
+ {'C','L','S','I','D','_','R','e','g','i','s','t','r','a','r',0};
|
|
|
|
+ static const WCHAR atl_dllW[] = {'a','t','l','.','d','l','l',0};
|
|
|
|
+
|
|
|
|
+ WCHAR clsid_str[40];
|
|
|
|
+ const struct _ATL_REGMAP_ENTRY reg_map[] = {{CLSID_RegistrarW, clsid_str}, {NULL,NULL}};
|
|
|
|
+
|
|
|
|
+ StringFromGUID2(&CLSID_Registrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR));
|
|
|
|
+ return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
|
|
|
|
+}
|
|
|
|
+
|
2013-09-14 18:22:37 +00:00
|
|
|
/**************************************************************
|
|
|
|
* DllGetClassObject (ATL.2)
|
|
|
|
*/
|
|
|
|
@@ -566,7 +621,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSI
|
2012-03-15 20:17:15 +00:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
|
|
|
- return __wine_register_resources( hInst );
|
|
|
|
+ /* Note: we can't use __wine_register_server here because it uses CLSID_Registrar which isn't registred yet */
|
|
|
|
+ return do_register_server(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2013-09-14 18:22:37 +00:00
|
|
|
@@ -574,7 +630,7 @@ HRESULT WINAPI DllRegisterServer(void)
|
2012-03-15 20:17:15 +00:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
|
|
|
- return __wine_unregister_resources( hInst );
|
|
|
|
+ return do_register_server(FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|