Piotr Caban : oleaut32: Improve ICreateTypeInfo_LayOut implementation.

Alexandre Julliard julliard at winehq.org
Tue Mar 16 11:49:17 CDT 2010


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Mar 15 23:40:31 2010 +0100

oleaut32: Improve ICreateTypeInfo_LayOut implementation.

---

 dlls/oleaut32/typelib2.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 3a92bad..a275845 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -2360,6 +2360,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(
 
     TRACE("(%p)\n", iface);
 
+    /* FIXME: LayOut should be run on all ImplTypes */
     if(This->typekind == TKIND_COCLASS)
         return S_OK;
 
@@ -2429,7 +2430,34 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(
         ITypeInfo_Release(cur);
     }
 
-    This->typeinfo->cbSizeVft = (This->typeinfo->datatype2>>16) * 4;
+    /* Get cbSizeVft of inherited interface */
+    /* Makes LayOut running recursively */
+    if(This->typeinfo->datatype1 != -1) {
+        ITypeInfo *cur, *inherited;
+        TYPEATTR *typeattr;
+
+        hres = ICreateTypeInfo_QueryInterface(iface, &IID_ITypeInfo, (void**)&cur);
+        if(FAILED(hres))
+            return hres;
+
+        hres = ITypeInfo_GetRefTypeInfo(cur, This->typeinfo->datatype1, &inherited);
+        ITypeInfo_Release(cur);
+        if(FAILED(hres))
+            return hres;
+
+        hres = ITypeInfo_GetTypeAttr(inherited, &typeattr);
+        if(FAILED(hres)) {
+            ITypeInfo_Release(inherited);
+            return hres;
+        }
+
+        This->typeinfo->cbSizeVft = typeattr->cbSizeVft;
+
+        ITypeInfo_ReleaseTypeAttr(inherited, typeattr);
+        ITypeInfo_Release(inherited);
+    } else
+        This->typeinfo->cbSizeVft = 0;
+
     if(!This->typedata)
         return S_OK;
 




More information about the wine-cvs mailing list