>From 64a58081ed199ce05001d53ac2daddf36efa3b20 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 11 Oct 2011 16:08:00 +1100
Subject: [PATCH] Register interfaces
To: wine-patches <wine-patches@winehq.org>

---
 dlls/mscoree/Makefile.in      |    2 +
 dlls/mscoree/mscoree_core.idl |   71 +++++++++++++++++++++++++++++++++++++++++
 dlls/mscoree/mscoree_main.c   |   11 ++++--
 3 files changed, 80 insertions(+), 4 deletions(-)
 create mode 100755 dlls/mscoree/mscoree_core.idl

diff --git a/dlls/mscoree/Makefile.in b/dlls/mscoree/Makefile.in
index a39c696..858591e 100644
--- a/dlls/mscoree/Makefile.in
+++ b/dlls/mscoree/Makefile.in
@@ -10,4 +10,6 @@ C_SRCS = \
 	metahost.c \
 	mscoree_main.c
 
+IDL_R_SRCS = mscoree_core.idl
+
 @MAKE_DLL_RULES@
diff --git a/dlls/mscoree/mscoree_core.idl b/dlls/mscoree/mscoree_core.idl
new file mode 100755
index 0000000..8c8207b
--- /dev/null
+++ b/dlls/mscoree/mscoree_core.idl
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2011 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+[
+    version(1),
+    progid("CLRMetaData.CLRRuntimehost.1"),    
+    uuid(90F1A06E-7712-4762-86B5-7A5EBA6BDB02),
+]
+coclass ICLRRuntimehost
+{
+}
+
+[
+    threading(both),
+    version(2),
+    progid("CLRMetaData.CLRRuntimehost.2"),
+    vi_progid("CLRMetaData.CLRRuntimehost"),
+    uuid(90F1A06E-7712-4762-86B5-7A5EBA6BDB02),
+]
+coclass CLRRuntimehost
+{
+}
+
+[
+    threading(both),
+    version(2),
+    progid("CLRMetaData.CorMetaDataDispenser.2"),
+    vi_progid("CLRMetaData.CorMetaDataDispenser"),
+    uuid(E5CB7A31-7512-11D2-89CE-0080C792E5D8),
+]
+coclass CorMetaDataDispenser
+{
+} 
+
+[
+    threading(both),
+    version(2),
+    progid("CLRMetaData.CorMetaDataDispenserRuntime.2"),
+    vi_progid("CLRMetaData.CorMetaDataDispenserRuntime"),
+    uuid(1EC2DE53-75CC-11d2-9775-00A0C9B4D50C),
+]
+coclass CorMetaDataDispenserRuntime
+{
+}
+
+
+[
+    threading(both),
+    version(2),
+    progid("CLRMetaData.CorRuntimeHost.2"),
+    vi_progid("CLRMetaData.CorRuntimeHost"),
+    uuid(CB2F6723-AB3A-11d2-9C40-00C04FA30A3E),
+]
+coclass CorRuntimeHost
+{
+}
diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index 64c226f..5ade4fc 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -44,11 +44,14 @@
 #include "fusion.h"
 #include "wine/list.h"
 #include "mscoree_private.h"
+#include "rpcproxy.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
 
+HINSTANCE MSCOREE_hInstance = NULL;
+
 char *WtoA(LPCWSTR wstr)
 {
     int length;
@@ -116,6 +119,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
 
+    MSCOREE_hInstance = hinstDLL;
+
     switch (fdwReason)
     {
     case DLL_WINE_PREATTACH:
@@ -508,14 +513,12 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
 
 HRESULT WINAPI DllRegisterServer(void)
 {
-    FIXME("\n");
-    return S_OK;
+    return __wine_register_resources( MSCOREE_hInstance );
 }
 
 HRESULT WINAPI DllUnregisterServer(void)
 {
-    FIXME("\n");
-    return S_OK;
+    return __wine_unregister_resources( MSCOREE_hInstance );
 }
 
 HRESULT WINAPI DllCanUnloadNow(VOID)
-- 
1.7.4.1

