Module: wine Branch: master Commit: 2fa16df55109bd01498c9cf572399dc288512a92 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2fa16df55109bd01498c9cf572...
Author: Andrew Eikum aeikum@codeweavers.com Date: Fri Jun 21 14:27:16 2013 -0500
oleaut32: Load referenced typelibs in the same architecture.
---
dlls/oleaut32/tests/typelib.c | 16 ++++++++++++++++ dlls/oleaut32/typelib.c | 25 ++++++++++++++----------- 2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 1919ea8..30468c1 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -1550,6 +1550,11 @@ static void test_CreateTypeLib(void) { hres = ITypeLib_GetTypeInfoOfGuid(stdole, &IID_IUnknown, &unknown); ok(hres == S_OK, "got %08x\n", hres);
+ hres = ITypeInfo_GetTypeAttr(unknown, &typeattr); + ok(hres == S_OK, "got %08x\n", hres); + ok(typeattr->cbSizeVft == 3 * sizeof(void*), "Got wrong cbSizeVft: %u\n", typeattr->cbSizeVft); + ITypeInfo_ReleaseTypeAttr(unknown, typeattr); + hres = ITypeLib_GetTypeInfoOfGuid(stdole, &IID_IDispatch, &dispatch); ok(hres == S_OK, "got %08x\n", hres);
@@ -1684,6 +1689,17 @@ static void test_CreateTypeLib(void) { ok(hres == S_OK, "got %08x\n", hres); ok(hreftype == 3, "hreftype = %d\n", hreftype);
+ hres = ITypeInfo_GetRefTypeInfo(interface1, hreftype, &ti); + ok(hres == S_OK, "got %08x\n", hres); + + hres = ITypeInfo_GetTypeAttr(ti, &typeattr); + ok(hres == S_OK, "got %08x\n", hres); + ok(typeattr->cbSizeVft == 12 || broken(typeattr->cbSizeVft == 24) /* xp64 */, + "retrieved IUnknown gave wrong cbSizeVft: %u\n", typeattr->cbSizeVft); + ITypeInfo_ReleaseTypeAttr(ti, typeattr); + + ITypeInfo_Release(ti); + hres = ITypeInfo_GetRefTypeOfImplType(interface1, -1, &hreftype); ok(hres == TYPE_E_ELEMENTNOTFOUND, "got %08x\n", hres);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index acf495f..24d250c 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7433,18 +7433,21 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo( ITypeLib_AddRef(pTLib); result = S_OK; } else { + BSTR libnam; + TRACE("typeinfo in imported typelib that isn't already loaded\n"); - result = LoadRegTypeLib( TLB_get_guid_null(ref_type->pImpTLInfo->guid), - ref_type->pImpTLInfo->wVersionMajor, - ref_type->pImpTLInfo->wVersionMinor, - ref_type->pImpTLInfo->lcid, - &pTLib); - - if(FAILED(result)) { - BSTR libnam=SysAllocString(ref_type->pImpTLInfo->name); - result=LoadTypeLib(libnam, &pTLib); - SysFreeString(libnam); - } + + result = query_typelib_path(TLB_get_guid_null(ref_type->pImpTLInfo->guid), + ref_type->pImpTLInfo->wVersionMajor, + ref_type->pImpTLInfo->wVersionMinor, + This->pTypeLib->syskind, + ref_type->pImpTLInfo->lcid, &libnam); + if(FAILED(result)) + libnam = SysAllocString(ref_type->pImpTLInfo->name); + + result = LoadTypeLib(libnam, &pTLib); + SysFreeString(libnam); + if(SUCCEEDED(result)) { ref_type->pImpTLInfo->pImpTypeLib = impl_from_ITypeLib(pTLib); ITypeLib_AddRef(pTLib);