From a1c4a345d9ca6f2363d8cd6d52cf86f9c6378b63 Mon Sep 17 00:00:00 2001
From: Ivan Sinitsin <ivan@etersoft.ru>
Date: Mon, 10 Jan 2011 18:40:23 +0300
Subject: [PATCH] fix bug #1994. Add implementation of IProvideTypeInfo interface.

Conflicts:

	dlls/mshtml/oleobj.c
---
 dlls/mshtml/oleobj.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c
index 2aa30f1..6dae692 100644
--- a/dlls/mshtml/oleobj.c
+++ b/dlls/mshtml/oleobj.c
@@ -855,6 +855,57 @@ static const IOleContainerVtbl OleContainerVtbl = {
     OleContainer_LockContainer
 };
 
+
+#define INFO_THIS(iface) DEFINE_THIS(HTMLDocument, Info, iface)
+
+static HRESULT WINAPI Info_QueryInterface(IProvideClassInfo* iface, REFIID riid, void **ppv)
+{
+    HTMLDocument *This = INFO_THIS(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI Info_AddRef(IProvideClassInfo* iface)
+{
+    HTMLDocument *This = INFO_THIS(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI Info_Release(IProvideClassInfo* iface)
+{
+    HTMLDocument *This = INFO_THIS(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI Info_GetClassInfo(IProvideClassInfo* iface, ITypeInfo **ppTI)
+{
+    HTMLDocument *This = INFO_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppTI);
+
+ /*   HRESULT hres;
+
+    hres = IDispatchEx_GetTypeInfo(DISPATCHEX(This), 0, 0, ppTI);
+    if (FAILED(hres)) {
+        FIXME("ERROR hres = %08x", hres);
+    }
+    ITypeInfo_AddRef(*ppTI);*/
+
+    /*WRONG, BUT FIX BUG #1994*/
+    *ppTI = (ITypeInfo*)HTMLDOC(This);
+    ITypeInfo_AddRef(*ppTI);
+
+    return S_OK;
+}
+
+#undef INFO_THIS
+
+static const IProvideClassInfoVtbl InfoVtbl = {
+    Info_QueryInterface,
+    Info_AddRef,
+    Info_Release,
+    Info_GetClassInfo
+};
+
+
 void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
 {
     IOleContainer *container;
@@ -878,4 +929,5 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
     This->IOleControl_iface.lpVtbl = &OleControlVtbl;
     This->lpObjectWithSiteVtbl = &ObjectWithSiteVtbl;
     This->IOleContainer_iface.lpVtbl = &OleContainerVtbl;
+    This->lpInfoVtbl = &InfoVtbl;
 }
-- 
1.7.3.4