Piotr Caban : oleaut32: Store PARAMDESCEX structure inside lprgelemdescParam.

Alexandre Julliard julliard at winehq.org
Tue Jul 30 14:14:22 CDT 2013


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jul 30 15:20:04 2013 +0200

oleaut32: Store PARAMDESCEX structure inside lprgelemdescParam.

Thanks to this change we don't need to free the data differently
depending on how it was created (by typelib reading or writing code).

---

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

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 44eea5b..a8916d8 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -2356,7 +2356,7 @@ MSFT_DoFuncs(TLBContext*     pcx,
             MSFT_ParameterInfo paraminfo;
 
             ptfd->funcdesc.lprgelemdescParam =
-                heap_alloc_zero(pFuncRec->nrargs * sizeof(ELEMDESC));
+                heap_alloc_zero(pFuncRec->nrargs * (sizeof(ELEMDESC) + sizeof(PARAMDESCEX)));
 
             ptfd->pParamDesc = TLBParDesc_Constructor(pFuncRec->nrargs);
 
@@ -2390,7 +2390,7 @@ MSFT_DoFuncs(TLBContext*     pcx,
 
                     PARAMDESC* pParamDesc = &elemdesc->u.paramdesc;
 
-                    pParamDesc->pparamdescex = heap_alloc_zero(sizeof(PARAMDESCEX));
+                    pParamDesc->pparamdescex = (PARAMDESCEX*)(ptfd->funcdesc.lprgelemdescParam+pFuncRec->nrargs)+j;
                     pParamDesc->pparamdescex->cBytes = sizeof(PARAMDESCEX);
 
 		    MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue),
@@ -5441,10 +5441,7 @@ static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
         {
             ELEMDESC *elemdesc = &pFInfo->funcdesc.lprgelemdescParam[j];
             if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
-            {
                 VariantClear(&elemdesc->u.paramdesc.pparamdescex->varDefaultValue);
-                heap_free(elemdesc->u.paramdesc.pparamdescex);
-            }
             TLB_FreeCustData(&pFInfo->pParamDesc[j].custdata_list);
         }
         heap_free(pFInfo->funcdesc.lprgelemdescParam);




More information about the wine-cvs mailing list