Module: wine Branch: master Commit: 430df1ca61d09fe1b501841ada4d641e18219222 URL: http://source.winehq.org/git/wine.git/?a=commit;h=430df1ca61d09fe1b501841ada... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jun 21 13:05:11 2015 +0200 mshtml: Added IHTMLXMLHttpRequest::onreadystatechange property implementation. --- dlls/mshtml/xmlhttprequest.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index c3efbbc..4cb3fda 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -17,6 +17,7 @@ */ #include <stdarg.h> +#include <assert.h> #define COBJMACROS @@ -28,6 +29,7 @@ #include "wine/debug.h" #include "mshtml_private.h" +#include "htmlevent.h" WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -169,15 +171,19 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText(IHTMLXMLHttpRequest *ifa static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT v) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, &v); } static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT *p) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, p); } static HRESULT WINAPI HTMLXMLHttpRequest_abort(IHTMLXMLHttpRequest *iface) @@ -246,12 +252,35 @@ static const IHTMLXMLHttpRequestVtbl HTMLXMLHttpRequestVtbl = { HTMLXMLHttpRequest_setRequestHeader }; +static inline HTMLXMLHttpRequest *impl_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, event_target.dispex); +} + +static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, int eid) +{ + HTMLXMLHttpRequest *This = impl_from_DispatchEx(dispex); + + FIXME("(%p)\n", This); + + assert(eid == EVENTID_READYSTATECHANGE); +} + +static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl = { + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLXMLHttpRequest_bind_event +}; + static const tid_t HTMLXMLHttpRequest_iface_tids[] = { IHTMLXMLHttpRequest_tid, 0 }; static dispex_static_data_t HTMLXMLHttpRequest_dispex = { - NULL, + &HTMLXMLHttpRequest_dispex_vtbl, DispHTMLXMLHttpRequest_tid, NULL, HTMLXMLHttpRequest_iface_tids