[PATCH 4/4] Added ICreateTypeInfo2::SetVarHelpContext()

Nikolay Sivov nsivov at codeweavers.com
Tue Dec 21 20:03:02 CST 2010


---
 dlls/oleaut32/typelib2.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 825dca5..e0e78ee 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -2206,7 +2206,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
     int var_type_size;
     int alignment;
 
-    TRACE("(%p,%d,%p), stub!\n", iface, index, pVarDesc);
+    TRACE("(%p,%d,%p)\n", iface, index, pVarDesc);
     TRACE("%d, %p, %d, {{%x, %d}, {%p, %x}}, 0x%x, %d\n", pVarDesc->memid, pVarDesc->lpstrSchema, pVarDesc->u.oInst,
 	  pVarDesc->elemdescVar.tdesc.u.hreftype, pVarDesc->elemdescVar.tdesc.vt,
 	  pVarDesc->elemdescVar.u.paramdesc.pparamdescex, pVarDesc->elemdescVar.u.paramdesc.wParamFlags,
@@ -2543,10 +2543,27 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpContext(
 static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext(
         ICreateTypeInfo2* iface,
         UINT index,
-        DWORD dwHelpContext)
+        DWORD context)
 {
-    FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpContext);
-    return E_OUTOFMEMORY;
+    ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
+    CyclicList *iter;
+
+    TRACE("(%p,%d,%d)\n", This, index, context);
+
+    if ((This->typeinfo->cElement >> 16) <= index)
+	return TYPE_E_ELEMENTNOTFOUND;
+
+    for (iter = This->typedata->next->next; iter != This->typedata; iter = iter->next)
+       if (iter->type == CyclicListVar)
+       {
+           if (index-- == 0)
+           {
+               iter->u.data[5] = context;
+               return S_OK;
+           }
+       }
+
+    return TYPE_E_ELEMENTNOTFOUND;
 }
 
 /******************************************************************************
-- 
1.5.6.5



--------------070702080709090304080408--



More information about the wine-patches mailing list