Andrew Eikum : oleaut32: Implement ICreateTypeInfo::SetCustData.

Alexandre Julliard julliard at winehq.org
Thu May 30 14:51:31 CDT 2013


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

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Wed May 29 15:00:01 2013 -0500

oleaut32: Implement ICreateTypeInfo::SetCustData.

---

 dlls/oleaut32/typelib.c |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index f903882..7fa395a 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -1739,6 +1739,40 @@ static TLBImplType *TLBImplType_Alloc(UINT n)
     return ret;
 }
 
+static HRESULT TLB_set_custdata(struct list *custdata_list, REFGUID guid, VARIANT *var)
+{
+    TLBCustData *cust_data;
+
+    switch(V_VT(var)){
+    case VT_I4:
+    case VT_R4:
+    case VT_UI4:
+    case VT_INT:
+    case VT_UINT:
+    case VT_HRESULT:
+    case VT_BSTR:
+        break;
+    default:
+        return DISP_E_BADVARTYPE;
+    }
+
+    cust_data = TLB_get_custdata_by_guid(custdata_list, guid);
+
+    if (!cust_data) {
+        cust_data = heap_alloc(sizeof(TLBCustData));
+        if (!cust_data)
+            return E_OUTOFMEMORY;
+
+        cust_data->guid = *guid;
+        VariantInit(&cust_data->data);
+
+        list_add_tail(custdata_list, &cust_data->entry);
+    }else
+        VariantClear(&cust_data->data);
+
+    return VariantCopy(&cust_data->data, var);
+}
+
 /**********************************************************************
  *
  *  Functions for reading MSFT typelibs (those created by CreateTypeLib2)
@@ -9031,8 +9065,13 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetCustData(ICreateTypeInfo2 *iface,
         REFGUID guid, VARIANT *varVal)
 {
     ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
-    FIXME("%p %s %p - stub\n", This, debugstr_guid(guid), varVal);
-    return E_NOTIMPL;
+
+    TRACE("%p %s %p\n", This, debugstr_guid(guid), varVal);
+
+    if (!guid || !varVal)
+        return E_INVALIDARG;
+
+    return TLB_set_custdata(&This->custdata_list, guid, varVal);
 }
 
 static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncCustData(ICreateTypeInfo2 *iface,




More information about the wine-cvs mailing list