[PATCH] mscoree: Return pointer to interface, not implementation

Nikolay Sivov nsivov at codeweavers.com
Thu Aug 25 14:04:26 CDT 2016


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/mscoree/cordebug.c | 4 ++--
 dlls/mscoree/metadata.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/mscoree/cordebug.c b/dlls/mscoree/cordebug.c
index 1a62e14..22424c6 100644
--- a/dlls/mscoree/cordebug.c
+++ b/dlls/mscoree/cordebug.c
@@ -434,7 +434,7 @@ static HRESULT CorDebugProcess_Create(CorDebug *cordebug, IUnknown** ppUnk, LPPR
     if(This->cordebug)
         ICorDebug_AddRef(&This->cordebug->ICorDebug_iface);
 
-    *ppUnk = (IUnknown*)This;
+    *ppUnk = (IUnknown*)&This->ICorDebugProcess_iface;
 
     return S_OK;
 }
@@ -780,7 +780,7 @@ HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown** ppUnk)
     if(This->runtimehost)
         ICLRRuntimeHost_AddRef(This->runtimehost);
 
-    *ppUnk = (IUnknown*)This;
+    *ppUnk = (IUnknown*)&This->ICorDebug_iface;
 
     return S_OK;
 }
diff --git a/dlls/mscoree/metadata.c b/dlls/mscoree/metadata.c
index 9ca0d93..457f756 100644
--- a/dlls/mscoree/metadata.c
+++ b/dlls/mscoree/metadata.c
@@ -199,7 +199,7 @@ HRESULT MetaDataDispenser_CreateInstance(IUnknown **ppUnk)
     This->IMetaDataDispenserEx_iface.lpVtbl = &MetaDataDispenserVtbl;
     This->ref = 1;
 
-    *ppUnk = (IUnknown*)This;
+    *ppUnk = (IUnknown*)&This->IMetaDataDispenserEx_iface;
 
     return S_OK;
 }
-- 
2.9.3




More information about the wine-patches mailing list