Piotr Caban : oleaut32: Added partial ICreateTypeInfo2_LayOut implementation.

Alexandre Julliard julliard at winehq.org
Mon Feb 22 08:46:50 CST 2010


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Feb 22 01:57:30 2010 +0100

oleaut32: Added partial ICreateTypeInfo2_LayOut implementation.

---

 dlls/oleaut32/typelib2.c |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 347ab7a..0f5d57f 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -1958,8 +1958,48 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeIdldesc(
 static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(
 	ICreateTypeInfo2* iface)
 {
-    TRACE("(%p), stub!\n", iface);
-/*     return E_OUTOFMEMORY; */
+    ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
+    CyclicList *iter, *iter2;
+    int i;
+
+    TRACE("(%p)\n", iface);
+
+    if(!This->typedata)
+        return S_OK;
+
+    /* Assign IDs and VTBL entries */
+    i = 0;
+    This->typeinfo->cbSizeVft = 0;
+    for(iter=This->typedata->next->next; iter!=This->typedata->next; iter=iter->next) {
+        if(iter->indice == MEMBERID_NIL)
+            FIXME("MEMBERID_NIL handling not yet implemented\n");
+
+        iter->u.data[0] = (iter->u.data[0]&0xffff) | (i<<16);
+
+        if((This->typeinfo->typekind&0xf) != TKIND_MODULE) {
+            iter->u.data[3] = (iter->u.data[3]&0xffff0000) | This->typeinfo->cbSizeVft;
+            This->typeinfo->cbSizeVft += 4;
+        }
+
+        /* Construct a list of elements with the same memberid */
+        iter->u.data[4] = (iter->u.data[4]&0xffff) | (i<<16);
+        for(iter2=This->typedata->next->next; iter2!=iter; iter2=iter2->next) {
+            if(iter->indice == iter2->indice) {
+                int v1, v2;
+
+                v1 = iter->u.data[4] >> 16;
+                v2 = iter2->u.data[4] >> 16;
+
+                iter->u.data[4] = (iter->u.data[4]&0xffff) | (v2<<16);
+                iter2->u.data[4] = (iter2->u.data[4]&0xffff) | (v1<<16);
+                break;
+            }
+        }
+
+        i++;
+    }
+
+    FIXME("Typeinfo validation not implemented\n");
     return S_OK;
 }
 




More information about the wine-cvs mailing list