[Wine-devel] Eter's patch is applied to winehq repo 07/18/11

builder на builder.office.etersoft.ru builder на builder.office.etersoft.ru
Пн Июл 18 22:20:10 MSD 2011


New Etersoft's patches since last build time:
commit 25c70bacc66d0c42d8996c5b303e3e63053b2ec9
Author: Alexander Morozov <amorozov на etersoft.ru>

    mshtml: Added IProvideClassInfo::GetClassInfo implementation.

---

commit 25c70bacc66d0c42d8996c5b303e3e63053b2ec9
Author: Alexander Morozov <amorozov на etersoft.ru>
Date:   Fri Jul 15 15:09:44 2011 +0400

    mshtml: Added IProvideClassInfo::GetClassInfo implementation.

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 327b5db..09de654 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -88,22 +88,30 @@ TID_LIST
 #undef XDIID
 };
 
-static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
+static HRESULT load_typelib(void)
 {
     HRESULT hres;
+    ITypeLib *tl;
 
-    if(!typelib) {
-        ITypeLib *tl;
+    hres = LoadRegTypeLib(&LIBID_MSHTML, 4, 0, LOCALE_SYSTEM_DEFAULT, &tl);
+    if(FAILED(hres)) {
+        ERR("LoadRegTypeLib failed: %08x\n", hres);
+        return hres;
+    }
 
-        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;
+}
 
-        if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
-            ITypeLib_Release(tl);
-    }
+static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
+{
+    HRESULT hres;
+
+    if (!typelib)
+        hres = load_typelib();
+    if (!typelib)
+        return hres;
 
     if(!typeinfos[tid]) {
         ITypeInfo *ti;
@@ -149,6 +157,21 @@ void release_typelib(void)
     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)
 {
     HRESULT hres;
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 5ba48cd..38d4bf3 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1798,9 +1798,8 @@ static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo* iface,
         ITypeInfo **ppTI)
 {
     HTMLDocument *This = impl_from_IProvideClassInfo(iface);
-    FIXME("(%p)->(%p)\n", This, ppTI);
-    *ppTI = NULL;
-    return E_NOTIMPL;
+    TRACE("(%p)->(%p)\n", This, ppTI);
+    return get_htmldoc_classinfo(ppTI);
 }
 
 static const IProvideClassInfoVtbl ProvideClassInfoVtbl = {
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 71afb8f..7a5b24e 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -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 remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*) DECLSPEC_HIDDEN;
 void release_typelib(void) DECLSPEC_HIDDEN;
+HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
 
 typedef struct HTMLWindow HTMLWindow;
 typedef struct HTMLDocumentNode HTMLDocumentNode;
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index b629071..045de7c 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -594,6 +594,42 @@ static void _test_disp2(unsigned line, IUnknown *unk, const IID *diid, const IID
         _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)
 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_disp((IUnknown*)doc2, &DIID_DispHTMLDocument, "[object]");
+    test_class_info((IUnknown*)doc2);
 
     test_ifaces((IUnknown*)doc, doc_obj_iids);
     test_disp((IUnknown*)doc, &DIID_DispHTMLDocument, "[object]");
+    test_class_info((IUnknown*)doc);
 
     unk = (void*)0xdeadbeef;
     hres = IHTMLDocument2_QueryInterface(doc2, &IID_ICustomDoc, (void**)&unk);


Подробная информация о списке рассылки Wine-devel