From a46e0c617b84226fba0fc70fd4030b20f91d9940 Mon Sep 17 00:00:00 2001 From: Thomas Mullaly Date: Sat, 26 Feb 2011 23:55:16 -0500 Subject: [PATCH] mshtml: Correctly forward IHTMLWindow's IHTMLDocument's ConnectionPointContainer. --- dlls/mshtml/conpoint.c | 2 +- dlls/mshtml/htmlwindow.c | 4 +++- dlls/mshtml/tests/events.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index df6c5cf2bcc..ca45524c33f 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -266,7 +266,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo TRACE("(%p)->(%s %p)\n", This, debugstr_cp_guid(riid), ppCP); if(This->forward_container) - return IConnectionPointContainer_FindConnectionPoint(&This->IConnectionPointContainer_iface, + return IConnectionPointContainer_FindConnectionPoint(&This->forward_container->IConnectionPointContainer_iface, riid, ppCP); *ppCP = NULL; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index d0d378f5ec2..a4fa1be09b0 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -40,6 +40,8 @@ static struct list window_list = LIST_INIT(window_list); static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) { if(window->doc) { + if(window->doc_obj && window == window->doc_obj->basedoc.window) + window->doc->basedoc.cp_container.forward_container = NULL; abort_document_bindings(window->doc); window->doc->basedoc.window = NULL; htmldoc_release(&window->doc->basedoc); @@ -2245,6 +2247,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML list_init(&window->script_hosts); window->task_magic = get_task_target_magic(); + *ret = window; update_window_doc(window); list_init(&window->children); @@ -2257,7 +2260,6 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML list_add_tail(&parent->children, &window->sibling_entry); } - *ret = window; return S_OK; } diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index b1d14238b61..bdb8460d569 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -2407,7 +2407,7 @@ static void test_empty_document(void) cp = get_cp((IUnknown*)doc, &IID_IDispatch); hres = IConnectionPoint_Unadvise(cp, cookie); IConnectionPoint_Release(cp); - todo_wine ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08x\n", hres); IHTMLDocument2_Release(windows_doc); }