From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 14 ++++++-------- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/xmlhttprequest.c | 4 +++- 3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index af1ece068f2..79cf3a48898 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1902,6 +1902,8 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN { HTMLWindow *This = impl_from_IHTMLWindow5(iface); HTMLInnerWindow *window = This->inner_window; + DispatchEx *constr; + HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
@@ -1910,16 +1912,12 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN return S_OK; }
- if(!window->constructors[PROT_XMLHttpRequest]) { - HRESULT hres; - - hres = HTMLXMLHttpRequestFactory_Create(window, &window->constructors[PROT_XMLHttpRequest]); - if(FAILED(hres)) - return hres; - } + hres = get_constructor(window, PROT_XMLHttpRequest, &constr); + if(FAILED(hres)) + return hres;
V_VT(p) = VT_DISPATCH; - V_DISPATCH(p) = (IDispatch*)&window->constructors[PROT_XMLHttpRequest]->IWineJSDispatchHost_iface; + V_DISPATCH(p) = (IDispatch*)&constr->IWineJSDispatchHost_iface; IDispatch_AddRef(V_DISPATCH(p));
return S_OK; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index fcfaae60bff..d5e93d2ef56 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1179,7 +1179,6 @@ HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,H HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); -HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); HRESULT create_html_screen(HTMLInnerWindow*,IHTMLScreen**); diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index c2730d4f7cd..cadf2909a07 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -1489,6 +1489,8 @@ static const event_target_vtbl_t HTMLXMLHttpRequest_event_target_vtbl = { .bind_event = HTMLXMLHttpRequest_bind_event };
+static HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); + static const tid_t HTMLXMLHttpRequest_iface_tids[] = { IHTMLXMLHttpRequest2_tid, 0 @@ -1674,7 +1676,7 @@ static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { .iface_tids = HTMLXMLHttpRequestFactory_iface_tids, };
-HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, DispatchEx **ret_ptr) +static HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_ptr) { HTMLXMLHttpRequestFactory *ret;