Commit 81768fe1 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Allocate the TYPEATTR rather than copying it.

For a dual interface the dispinterface's cfuncs should include the inherited functions, cbSizeVft should just be the size of IDispatch's vtbl and we should strip TYPEFLAG_FOLEAUTOMATION.
parent 478f3e30
...@@ -4127,8 +4127,14 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface, ...@@ -4127,8 +4127,14 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface,
{ {
ITypeInfoImpl *This = (ITypeInfoImpl *)iface; ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
/* FIXME: must do a copy here */ *ppTypeAttr = HeapAlloc(GetProcessHeap(), 0, sizeof(**ppTypeAttr));
*ppTypeAttr=&This->TypeAttr; memcpy(*ppTypeAttr, &This->TypeAttr, sizeof(**ppTypeAttr));
if((*ppTypeAttr)->typekind == TKIND_DISPATCH && (*ppTypeAttr)->wTypeFlags & TYPEFLAG_FDUAL) {
(*ppTypeAttr)->cFuncs = (*ppTypeAttr)->cbSizeVft / 4; /* This should include all the inherited
funcs */
(*ppTypeAttr)->cbSizeVft = 28; /* This is always the size of IDispatch's vtbl */
(*ppTypeAttr)->wTypeFlags &= ~TYPEFLAG_FOLEAUTOMATION;
}
return S_OK; return S_OK;
} }
...@@ -5176,6 +5182,7 @@ static void WINAPI ITypeInfo_fnReleaseTypeAttr( ITypeInfo2 *iface, ...@@ -5176,6 +5182,7 @@ static void WINAPI ITypeInfo_fnReleaseTypeAttr( ITypeInfo2 *iface,
{ {
ITypeInfoImpl *This = (ITypeInfoImpl *)iface; ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)->(%p)\n", This, pTypeAttr); TRACE("(%p)->(%p)\n", This, pTypeAttr);
HeapFree(GetProcessHeap(), 0, pTypeAttr);
} }
/* ITypeInfo::ReleaseFuncDesc /* ITypeInfo::ReleaseFuncDesc
......
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