Commit ed749f51 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Use IDispatch vtable size instead of hardcoded value.

parent b09fd556
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment