Dmitry Timoshkov : oleaut32: Do not rely on vtable placement in the implementation structure.

Alexandre Julliard julliard at winehq.org
Thu Jun 13 14:31:19 CDT 2013


Module: wine
Branch: master
Commit: eca18b515264be5017e0e62a69807757e6cac298
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eca18b515264be5017e0e62a69807757e6cac298

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Jun 13 11:28:21 2013 +0900

oleaut32: Do not rely on vtable placement in the implementation structure.

---

 dlls/oleaut32/typelib.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 024df0d..9502b3c 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -8358,13 +8358,13 @@ HRESULT WINAPI CreateTypeLib2(SYSKIND syskind, LPCOLESTR szFile,
 
     This->path = heap_alloc((lstrlenW(szFile) + 1) * sizeof(WCHAR));
     if (!This->path) {
-        ITypeLib2_Release((ITypeLib2*)This);
+        ITypeLib2_Release(&This->ITypeLib2_iface);
         return E_OUTOFMEMORY;
     }
     lstrcpyW(This->path, szFile);
 
-    hres = ITypeLib2_QueryInterface((ITypeLib2*)This, &IID_ICreateTypeLib2, (LPVOID*)ppctlib);
-    ITypeLib2_Release((ITypeLib2*)This);
+    hres = ITypeLib2_QueryInterface(&This->ITypeLib2_iface, &IID_ICreateTypeLib2, (LPVOID*)ppctlib);
+    ITypeLib2_Release(&This->ITypeLib2_iface);
     return hres;
 }
 
@@ -8373,21 +8373,21 @@ static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(ICreateTypeLib2 *iface,
 {
     ITypeLibImpl *This = impl_from_ICreateTypeLib2(iface);
 
-    return ITypeLib2_QueryInterface((ITypeLib2*)This, riid, object);
+    return ITypeLib2_QueryInterface(&This->ITypeLib2_iface, riid, object);
 }
 
 static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface)
 {
     ITypeLibImpl *This = impl_from_ICreateTypeLib2(iface);
 
-    return ITypeLib2_AddRef((ITypeLib2*)This);
+    return ITypeLib2_AddRef(&This->ITypeLib2_iface);
 }
 
 static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface)
 {
     ITypeLibImpl *This = impl_from_ICreateTypeLib2(iface);
 
-    return ITypeLib2_Release((ITypeLib2*)This);
+    return ITypeLib2_Release(&This->ITypeLib2_iface);
 }
 
 static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo(ICreateTypeLib2 *iface,
@@ -9883,21 +9883,21 @@ static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface(ICreateTypeInfo2 *iface,
 {
     ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
 
-    return ITypeInfo2_QueryInterface((ITypeInfo2*)This, riid, object);
+    return ITypeInfo2_QueryInterface(&This->ITypeInfo2_iface, riid, object);
 }
 
 static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface)
 {
     ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
 
-    return ITypeInfo2_AddRef((ITypeInfo2*)This);
+    return ITypeInfo2_AddRef(&This->ITypeInfo2_iface);
 }
 
 static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface)
 {
     ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
 
-    return ITypeInfo2_Release((ITypeInfo2*)This);
+    return ITypeInfo2_Release(&This->ITypeInfo2_iface);
 }
 
 static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface,




More information about the wine-cvs mailing list