mshtml: Added IProvideClassInfo::GetClassInfo implementation.
This commit is contained in:
parent
b3fbdfa908
commit
25c70bacc6
|
@ -88,22 +88,30 @@ TID_LIST
|
||||||
#undef XDIID
|
#undef XDIID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static HRESULT load_typelib(void)
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
ITypeLib *tl;
|
||||||
|
|
||||||
|
hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &tl);
|
||||||
|
if(FAILED(hres)) {
|
||||||
|
ERR("LoadRegTypeLib failed: %08x\n", hres);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
|
||||||
|
ITypeLib_Release(tl);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
|
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!typelib) {
|
if (!typelib)
|
||||||
ITypeLib *tl;
|
hres = load_typelib();
|
||||||
|
if (!typelib)
|
||||||
hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &tl);
|
return hres;
|
||||||
if(FAILED(hres)) {
|
|
||||||
ERR("LoadRegTypeLib failed: %08x\n", hres);
|
|
||||||
return hres;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
|
|
||||||
ITypeLib_Release(tl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!typeinfos[tid]) {
|
if(!typeinfos[tid]) {
|
||||||
ITypeInfo *ti;
|
ITypeInfo *ti;
|
||||||
|
@ -149,6 +157,21 @@ void release_typelib(void)
|
||||||
ITypeLib_Release(typelib);
|
ITypeLib_Release(typelib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo)
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
if (!typelib)
|
||||||
|
hres = load_typelib();
|
||||||
|
if (!typelib)
|
||||||
|
return hres;
|
||||||
|
|
||||||
|
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &CLSID_HTMLDocument, typeinfo);
|
||||||
|
if(FAILED(hres))
|
||||||
|
ERR("GetTypeInfoOfGuid failed: %08x\n", hres);
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUNCDESC *desc, ITypeInfo *dti)
|
static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUNCDESC *desc, ITypeInfo *dti)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
|
@ -1798,9 +1798,8 @@ static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo* iface,
|
||||||
ITypeInfo **ppTI)
|
ITypeInfo **ppTI)
|
||||||
{
|
{
|
||||||
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
HTMLDocument *This = impl_from_IProvideClassInfo(iface);
|
||||||
FIXME("(%p)->(%p)\n", This, ppTI);
|
TRACE("(%p)->(%p)\n", This, ppTI);
|
||||||
*ppTI = NULL;
|
return get_htmldoc_classinfo(ppTI);
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IProvideClassInfoVtbl ProvideClassInfoVtbl = {
|
static const IProvideClassInfoVtbl ProvideClassInfoVtbl = {
|
||||||
|
|
|
@ -213,6 +213,7 @@ HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**) DECLSPEC_H
|
||||||
HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN;
|
HRESULT get_dispids(tid_t,DWORD*,DISPID**) DECLSPEC_HIDDEN;
|
||||||
HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*) DECLSPEC_HIDDEN;
|
HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*) DECLSPEC_HIDDEN;
|
||||||
void release_typelib(void) DECLSPEC_HIDDEN;
|
void release_typelib(void) DECLSPEC_HIDDEN;
|
||||||
|
HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
typedef struct HTMLWindow HTMLWindow;
|
typedef struct HTMLWindow HTMLWindow;
|
||||||
typedef struct HTMLDocumentNode HTMLDocumentNode;
|
typedef struct HTMLDocumentNode HTMLDocumentNode;
|
||||||
|
|
|
@ -594,6 +594,42 @@ static void _test_disp2(unsigned line, IUnknown *unk, const IID *diid, const IID
|
||||||
_test_disp_value(line, unk, val);
|
_test_disp_value(line, unk, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define test_class_info(u) _test_class_info(__LINE__,u)
|
||||||
|
static void _test_class_info(unsigned line, IUnknown *unk)
|
||||||
|
{
|
||||||
|
IProvideClassInfo *classinfo;
|
||||||
|
ITypeInfo *typeinfo;
|
||||||
|
TYPEATTR *type_attr;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
hres = IUnknown_QueryInterface(unk, &IID_IProvideClassInfo, (void**)&classinfo);
|
||||||
|
ok_(__FILE__,line)(hres == S_OK, "Could not get IProvideClassInfo interface: %08x\n", hres);
|
||||||
|
if(FAILED(hres))
|
||||||
|
return;
|
||||||
|
|
||||||
|
hres = IProvideClassInfo_GetClassInfo(classinfo, &typeinfo);
|
||||||
|
ok_(__FILE__,line)(hres == S_OK, "Could not get ITypeInfo interface: %08x\n", hres);
|
||||||
|
if(FAILED(hres))
|
||||||
|
{
|
||||||
|
IProvideClassInfo_Release(classinfo);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr);
|
||||||
|
ok_(__FILE__,line)(hres == S_OK, "GetTypeAttr failed: %08x\n", hres);
|
||||||
|
if(SUCCEEDED(hres))
|
||||||
|
{
|
||||||
|
ok_(__FILE__,line)(IsEqualGUID(&type_attr->guid, &CLSID_HTMLDocument),
|
||||||
|
"unexpected guid %s\n", dbgstr_guid(&type_attr->guid));
|
||||||
|
ok_(__FILE__,line)(type_attr->typekind == TKIND_COCLASS,
|
||||||
|
"unexpected typekind %d\n", type_attr->typekind);
|
||||||
|
ITypeInfo_ReleaseTypeAttr(typeinfo, type_attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ITypeInfo_Release(typeinfo);
|
||||||
|
IProvideClassInfo_Release(classinfo);
|
||||||
|
}
|
||||||
|
|
||||||
#define set_dispex_value(a,b,c) _set_dispex_value(__LINE__,a,b,c)
|
#define set_dispex_value(a,b,c) _set_dispex_value(__LINE__,a,b,c)
|
||||||
static void _set_dispex_value(unsigned line, IUnknown *unk, const char *name, VARIANT *val)
|
static void _set_dispex_value(unsigned line, IUnknown *unk, const char *name, VARIANT *val)
|
||||||
{
|
{
|
||||||
|
@ -5958,9 +5994,11 @@ static void test_window(IHTMLDocument2 *doc)
|
||||||
|
|
||||||
test_ifaces((IUnknown*)doc2, doc_node_iids);
|
test_ifaces((IUnknown*)doc2, doc_node_iids);
|
||||||
test_disp((IUnknown*)doc2, &DIID_DispHTMLDocument, "[object]");
|
test_disp((IUnknown*)doc2, &DIID_DispHTMLDocument, "[object]");
|
||||||
|
test_class_info((IUnknown*)doc2);
|
||||||
|
|
||||||
test_ifaces((IUnknown*)doc, doc_obj_iids);
|
test_ifaces((IUnknown*)doc, doc_obj_iids);
|
||||||
test_disp((IUnknown*)doc, &DIID_DispHTMLDocument, "[object]");
|
test_disp((IUnknown*)doc, &DIID_DispHTMLDocument, "[object]");
|
||||||
|
test_class_info((IUnknown*)doc);
|
||||||
|
|
||||||
unk = (void*)0xdeadbeef;
|
unk = (void*)0xdeadbeef;
|
||||||
hres = IHTMLDocument2_QueryInterface(doc2, &IID_ICustomDoc, (void**)&unk);
|
hres = IHTMLDocument2_QueryInterface(doc2, &IID_ICustomDoc, (void**)&unk);
|
||||||
|
|
Loading…
Reference in New Issue