oleaut32: Improve ITypeInfo2 GetTypeAttr implementation.

This commit is contained in:
Piotr Caban 2010-03-17 22:04:53 +01:00 committed by Alexandre Julliard
parent 7c930589bc
commit 45306f8671
2 changed files with 3 additions and 1 deletions

View File

@ -1386,7 +1386,7 @@ static void test_CreateTypeLib(void) {
ok(hres == S_OK, "got %08x\n", hres);
ok(typeattr->cbSizeInstance == 4, "cbSizeInstance = %d\n", typeattr->cbSizeInstance);
ok(typeattr->typekind == 4, "typekind = %d\n", typeattr->typekind);
todo_wine ok(typeattr->cFuncs == 8, "cFuncs = %d\n", typeattr->cFuncs);
ok(typeattr->cFuncs == 8, "cFuncs = %d\n", typeattr->cFuncs);
ok(typeattr->cVars == 0, "cVars = %d\n", typeattr->cVars);
ok(typeattr->cImplTypes == 1, "cImplTypes = %d\n", typeattr->cImplTypes);
ok(typeattr->cbSizeVft == 28, "cbSizeVft = %d\n", typeattr->cbSizeVft);

View File

@ -2919,6 +2919,8 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeAttr(
(*ppTypeAttr)->cbSizeInstance = This->typeinfo->size;
(*ppTypeAttr)->typekind = This->typekind;
(*ppTypeAttr)->cFuncs = This->typeinfo->cElement&0xffff;
if(This->typeinfo->flags&TYPEFLAG_FDUAL && This->typekind==TKIND_DISPATCH)
(*ppTypeAttr)->cFuncs += 7;
(*ppTypeAttr)->cVars = This->typeinfo->cElement>>16;
(*ppTypeAttr)->cImplTypes = This->typeinfo->cImplTypes;
(*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 28 : This->typeinfo->cbSizeVft;