Kevin Puetz : oleaut32: Use ITypeInfoImpl_GetInternalFuncDesc in ITypeInfo2_fnGetFuncCustData.

Alexandre Julliard julliard at winehq.org
Mon Feb 10 16:32:45 CST 2020


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

Author: Kevin Puetz <PuetzKevinA at JohnDeere.com>
Date:   Mon Feb 10 14:56:54 2020 +0100

oleaut32: Use ITypeInfoImpl_GetInternalFuncDesc in ITypeInfo2_fnGetFuncCustData.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/typelib.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 4d8bd256be..6375dc3de0 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -1727,7 +1727,7 @@ static inline TLBVarDesc *TLB_get_vardesc_by_name(ITypeInfoImpl *typeinfo, const
     return NULL;
 }
 
-static inline TLBCustData *TLB_get_custdata_by_guid(struct list *custdata_list, REFGUID guid)
+static inline TLBCustData *TLB_get_custdata_by_guid(const struct list *custdata_list, REFGUID guid)
 {
     TLBCustData *cust_data;
     LIST_FOR_EACH_ENTRY(cust_data, custdata_list, TLBCustData, entry)
@@ -8388,14 +8388,20 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData(
 {
     ITypeInfoImpl *This = impl_from_ITypeInfo2(iface);
     TLBCustData *pCData;
-    TLBFuncDesc *pFDesc = &This->funcdescs[index];
+    const TLBFuncDesc *desc;
+    UINT hrefoffset;
+    HRESULT hr;
 
     TRACE("%p %u %s %p\n", This, index, debugstr_guid(guid), pVarVal);
 
-    if(index >= This->typeattr.cFuncs)
-        return TYPE_E_ELEMENTNOTFOUND;
+    hr = ITypeInfoImpl_GetInternalFuncDesc((ITypeInfo *)iface, index, &desc, &hrefoffset);
+    if (FAILED(hr))
+    {
+        WARN("description for function %d not found\n", index);
+        return hr;
+    }
 
-    pCData = TLB_get_custdata_by_guid(&pFDesc->custdata_list, guid);
+    pCData = TLB_get_custdata_by_guid(&desc->custdata_list, guid);
     if(!pCData)
         return TYPE_E_ELEMENTNOTFOUND;
 




More information about the wine-cvs mailing list