[PATCH 3/4] oleaut32: Load referenced typelibs in the same architecture
Andrew Eikum
aeikum at codeweavers.com
Fri Jun 21 14:27:16 CDT 2013
---
dlls/oleaut32/tests/typelib.c | 16 ++++++++++++++++
dlls/oleaut32/typelib.c | 23 +++++++++++++----------
2 files changed, 29 insertions(+), 10 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);
--
1.8.3.1
More information about the wine-patches
mailing list