* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <precomp.h>
-
#include <stdio.h>
-#include <rpcproxy.h>
+
+#define COBJMACROS
+
+#include "objidl.h"
+#include "rpcproxy.h"
+#include "wine/atlbase.h"
+#include "wine/atlwin.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(atl);
extern HINSTANCE atl_instance;
if (!wci->m_wc.lpszClassName)
{
- snprintf(wci->m_szAutoName, sizeof(wci->m_szAutoName), "ATL%08lx", (UINT_PTR)wci);
+#ifdef __REACTOS__
+ sprintf(wci->m_szAutoName, "ATL:%p", wci);
+#else
+ sprintf(wci->m_szAutoName, "ATL%08lx", (UINT_PTR)wci);
+#endif
TRACE("auto-generated class name %s\n", wci->m_szAutoName);
wci->m_wc.lpszClassName = wci->m_szAutoName;
}
if (!wci->m_wc.lpszClassName)
{
+#ifdef __REACTOS__
+ static const WCHAR szFormat[] = {'A','T','L',':','%','p',0};
+#else
static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
- snprintfW(wci->m_szAutoName, sizeof(wci->m_szAutoName)/sizeof(WCHAR), szFormat, (UINT_PTR)wci);
+#endif
+ swprintf(wci->m_szAutoName, szFormat, (UINT_PTR)wci);
TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
wci->m_wc.lpszClassName = wci->m_szAutoName;
}
static IClassFactory RegistrarCF = { &IRegistrarCFVtbl };
+#ifdef __REACTOS__
static HRESULT do_register_dll_server(IRegistrar *pRegistrar, LPCOLESTR wszDll,
LPCOLESTR wszId, BOOL do_register,
const struct _ATL_REGMAP_ENTRY* pMapEntries)
StringFromGUID2(&CLSID_Registrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR));
return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
}
-
+#endif
/**************************************************************
* DllGetClassObject (ATL.2)
*/
HRESULT WINAPI DllRegisterServer(void)
{
+#ifdef __REACTOS__
/* Note: we can't use __wine_register_server here because it uses CLSID_Registrar which isn't registred yet */
return do_register_server(TRUE);
+#else
+ return __wine_register_resources( atl_instance );
+#endif
}
/***********************************************************************
*/
HRESULT WINAPI DllUnregisterServer(void)
{
+#ifdef __REACTOS__
return do_register_server(FALSE);
+#else
+ return __wine_unregister_resources( atl_instance );
+#endif
}
/***********************************************************************