oleaut32: Load referenced typelibs in the same architecture.

This commit is contained in:
Andrew Eikum 2013-06-21 14:27:16 -05:00 committed by Alexandre Julliard
parent 82376431e8
commit 2fa16df551
2 changed files with 30 additions and 11 deletions

View File

@ -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);

View File

@ -7433,18 +7433,21 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
ITypeLib_AddRef(pTLib);
result = S_OK;
} else {
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);
BSTR libnam;
TRACE("typeinfo in imported typelib that isn't already loaded\n");
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(FAILED(result)) {
BSTR 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);