Nikolay Sivov : oleaut32: Use IDispatch vtable size instead of hardcoded value.

Alexandre Julliard julliard at winehq.org
Tue Jan 4 09:47:31 CST 2011


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Jan  4 14:00:13 2011 +0300

oleaut32: Use IDispatch vtable size instead of hardcoded value.

---

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

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index d9fa638..199d2ba 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -1082,7 +1082,7 @@ typedef struct tagTLBVarDesc
     VARDESC vardesc;        /* lots of info on the variable and its attributes. */
     BSTR Name;             /* the name of this variable */
     int HelpContext;
-    int HelpStringContext;  /* FIXME: where? */
+    int HelpStringContext;
     BSTR HelpString;
     int ctCustData;
     TLBCustData * pCustData;/* linked list to cust data; */
@@ -5110,7 +5110,8 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface,
     if((*ppTypeAttr)->typekind == TKIND_DISPATCH) {
         /* This should include all the inherited funcs */
         (*ppTypeAttr)->cFuncs = (*ppTypeAttr)->cbSizeVft / sizeof(void *);
-        (*ppTypeAttr)->cbSizeVft = 7 * sizeof(void *); /* This is always the size of IDispatch's vtbl */
+        /* This is always the size of IDispatch's vtbl */
+        (*ppTypeAttr)->cbSizeVft = sizeof(IDispatchVtbl);
         (*ppTypeAttr)->wTypeFlags &= ~TYPEFLAG_FOLEAUTOMATION;
     }
     return S_OK;
diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index fdf712b..6cc1081 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -3207,10 +3207,10 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeAttr(
     (*ppTypeAttr)->typekind = This->typekind;
     (*ppTypeAttr)->cFuncs = cti2_get_func_count(This->typeinfo);
     if(This->typeinfo->flags&TYPEFLAG_FDUAL && This->typekind==TKIND_DISPATCH)
-        (*ppTypeAttr)->cFuncs += 7;
+        (*ppTypeAttr)->cFuncs += sizeof(IDispatchVtbl)/sizeof(void*);
     (*ppTypeAttr)->cVars = cti2_get_var_count(This->typeinfo);
     (*ppTypeAttr)->cImplTypes = This->typeinfo->cImplTypes;
-    (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 7 * sizeof(void*) : This->typeinfo->cbSizeVft;
+    (*ppTypeAttr)->cbSizeVft = This->typekind == TKIND_DISPATCH ? sizeof(IDispatchVtbl) : This->typeinfo->cbSizeVft;
     (*ppTypeAttr)->cbAlignment = (This->typeinfo->typekind>>11) & 0x1f;
     (*ppTypeAttr)->wTypeFlags = This->typeinfo->flags;
     (*ppTypeAttr)->wMajorVerNum = LOWORD(This->typeinfo->version);




More information about the wine-cvs mailing list