From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 49 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 3ab42af0fa4..3cbc4a8f3ef 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3619,24 +3619,6 @@ static HRESULT WINAPI WindowDispEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID TRACE("(%p)->(%lx %lx %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
switch(id) { - case DISPID_IHTMLWINDOW2_LOCATION: { - HTMLLocation *location; - HRESULT hres; - - if(!(wFlags & DISPATCH_PROPERTYPUT)) - break; - - TRACE("forwarding to location.href\n"); - - hres = get_location(window, &location); - if(FAILED(hres)) - return hres; - - hres = IDispatchEx_InvokeEx(&location->dispex.IDispatchEx_iface, DISPID_VALUE, lcid, - wFlags, pdp, pvarRes, pei, pspCaller); - IHTMLLocation_Release(&location->IHTMLLocation_iface); - return hres; - } case DISPID_IHTMLWINDOW2_SETTIMEOUT: case DISPID_IHTMLWINDOW3_SETTIMEOUT: { VARIANT args[2]; @@ -3912,8 +3894,37 @@ static void HTMLWindow_bind_event(DispatchEx *dispex, eventid_t eid) ensure_doc_nsevent_handler(This->doc, NULL, eid); }
+static HRESULT IHTMLWindow2_location_hook(DispatchEx *dispex, WORD flags, DISPPARAMS *dp, VARIANT *res, + EXCEPINFO *ei, IServiceProvider *caller) +{ + HTMLInnerWindow *This = impl_from_DispatchEx(dispex); + HTMLLocation *location; + HRESULT hres; + + if(!(flags & DISPATCH_PROPERTYPUT)) + return S_FALSE; + + TRACE("forwarding to location.href\n"); + + hres = get_location(This, &location); + if(FAILED(hres)) + return hres; + + hres = IDispatchEx_InvokeEx(&location->dispex.IDispatchEx_iface, DISPID_VALUE, 0, flags, dp, res, ei, caller); + IHTMLLocation_Release(&location->IHTMLLocation_iface); + return hres; +} + static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) { + static const dispex_hook_t window2_hooks[] = { + {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, + /* DispHTMLWindow2 uses these from IHTMLWindow3 */ + {DISPID_IHTMLWINDOW2_SETTIMEOUT}, + {DISPID_IHTMLWINDOW2_SETINTERVAL}, + {DISPID_UNKNOWN} + }; + if(compat_mode >= COMPAT_MODE_IE9) dispex_info_add_interface(info, IHTMLWindow7_tid, NULL); else @@ -3922,6 +3933,7 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa dispex_info_add_interface(info, IWineHTMLWindowPrivate_tid, NULL);
dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); + dispex_info_add_interface(info, IHTMLWindow2_tid, window2_hooks); EventTarget_init_dispex_info(info, compat_mode); }
@@ -3948,7 +3960,6 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = { };
static const tid_t HTMLWindow_iface_tids[] = { - IHTMLWindow2_tid, IHTMLWindow3_tid, IHTMLWindow4_tid, IHTMLWindow6_tid,