Commit 7edbbe1e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msxml3: Load the version 1 typelib before trying to access it.

parent c742a4e1
...@@ -150,31 +150,43 @@ static inline unsigned get_libid_from_tid(tid_t tid) ...@@ -150,31 +150,43 @@ static inline unsigned get_libid_from_tid(tid_t tid)
return tid_ids[tid].lib; return tid_ids[tid].lib;
} }
HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo) static HRESULT get_typelib(unsigned lib, ITypeLib **tl)
{ {
unsigned lib = get_libid_from_tid(tid);
HRESULT hres; HRESULT hres;
if(!typelib[lib]) { if(!typelib[lib]) {
ITypeLib *tl; hres = LoadRegTypeLib(lib_ids[lib].iid, lib_ids[lib].major, 0, LOCALE_SYSTEM_DEFAULT, tl);
hres = LoadRegTypeLib(lib_ids[lib].iid, lib_ids[lib].major, 0, LOCALE_SYSTEM_DEFAULT, &tl);
if(FAILED(hres)) { if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08x\n", hres); ERR("LoadRegTypeLib failed: %08x\n", hres);
return hres; return hres;
} }
if(InterlockedCompareExchangePointer((void**)&typelib[lib], tl, NULL)) if (InterlockedCompareExchangePointer((void**)&typelib[lib], *tl, NULL))
ITypeLib_Release(tl); ITypeLib_Release(*tl);
} }
*tl = typelib[lib];
return S_OK;
}
HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
{
unsigned lib = get_libid_from_tid(tid);
ITypeLib *typelib;
HRESULT hres;
if (FAILED(hres = get_typelib(lib, &typelib)))
return hres;
if(!typeinfos[tid]) { if(!typeinfos[tid]) {
ITypeInfo *ti; ITypeInfo *ti;
hres = ITypeLib_GetTypeInfoOfGuid(typelib[lib], get_riid_from_tid(tid), &ti); hres = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti);
if(FAILED(hres)) { if(FAILED(hres)) {
/* try harder with typelib from msxml.dll */ /* try harder with typelib from msxml.dll */
hres = ITypeLib_GetTypeInfoOfGuid(typelib[LibXml], get_riid_from_tid(tid), &ti); if (FAILED(hres = get_typelib(LibXml, &typelib)))
return hres;
hres = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti);
if(FAILED(hres)) { if(FAILED(hres)) {
ERR("GetTypeInfoOfGuid failed: %08x\n", hres); ERR("GetTypeInfoOfGuid failed: %08x\n", hres);
return hres; return hres;
......
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