Jacek Caban : mshtml: Added IHTMLWindow2::get_self implementation.

Alexandre Julliard julliard at winehq.org
Tue Jul 1 08:27:29 CDT 2008


Module: wine
Branch: master
Commit: f58b963f4bb6fc986c7161a3eca44c84ae8e57ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f58b963f4bb6fc986c7161a3eca44c84ae8e57ad

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jun 30 21:37:41 2008 +0200

mshtml: Added IHTMLWindow2::get_self implementation.

---

 dlls/mshtml/htmlwindow.c |    9 +++++++--
 dlls/mshtml/tests/dom.c  |   16 +++++++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index 3a9a17b..edd9491 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -321,8 +321,13 @@ static HRESULT WINAPI HTMLWindow2_open(IHTMLWindow2 *iface, BSTR url, BSTR name,
 static HRESULT WINAPI HTMLWindow2_get_self(IHTMLWindow2 *iface, IHTMLWindow2 **p)
 {
     HTMLWindow *This = HTMLWINDOW2_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    /* FIXME: We should return kind of proxy window here. */
+    IHTMLWindow2_AddRef(HTMLWINDOW2(This));
+    *p = HTMLWINDOW2(This);
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLWindow2_get_top(IHTMLWindow2 *iface, IHTMLWindow2 **p)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index d06ad4c..92a240e 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1821,7 +1821,7 @@ static void test_default_body(IHTMLBodyElement *body)
 
 static void test_window(IHTMLDocument2 *doc)
 {
-    IHTMLWindow2 *window;
+    IHTMLWindow2 *window, *window2, *self;
     IHTMLDocument2 *doc2 = NULL;
     HRESULT hres;
 
@@ -1835,6 +1835,20 @@ static void test_window(IHTMLDocument2 *doc)
     ok(doc2 != NULL, "doc2 == NULL\n");
 
     IHTMLDocument_Release(doc2);
+
+    hres = IHTMLWindow2_get_window(window, &window2);
+    ok(hres == S_OK, "get_window failed: %08x\n", hres);
+    ok(window2 != NULL, "window2 == NULL\n");
+
+    hres = IHTMLWindow2_get_self(window, &self);
+    ok(hres == S_OK, "get_window failed: %08x\n", hres);
+    ok(window2 != NULL, "self == NULL\n");
+
+    ok(self == window2, "self != window2\n");
+
+    IHTMLWindow2_Release(window2);
+    IHTMLWindow2_Release(self);
+
     IHTMLWindow2_Release(window);
 }
 




More information about the wine-cvs mailing list