diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 3a9a17b93c6..edd94911d6e 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 d06ad4c6462..92a240ecf64 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); }