54 ERR(
"failed: %08x\n", nsres);
100 {
'o',
'n',
'r',
'e',
'a',
'd',
'y',
's',
't',
'a',
't',
'e',
'c',
'h',
'a',
'n',
'g',
'e',0};
102 nsres = nsIXMLHttpRequest_QueryInterface(event_listener->
xhr->
nsxhr, &IID_nsIDOMEventTarget, (
void**)&event_target);
108 nsIDOMEventTarget_Release(event_target);
138 nsIDOMEventListener_AddRef(&
This->nsIDOMEventListener_iface);
200 *
ppv = &
This->IHTMLXMLHttpRequest_iface;
202 *
ppv = &
This->IHTMLXMLHttpRequest_iface;
204 *
ppv = &
This->IHTMLXMLHttpRequest_iface;
235 if(
This->event_listener)
238 nsIXMLHttpRequest_Release(
This->nsxhr);
248 return IDispatchEx_GetTypeInfoCount(&
This->event_target.dispex.IDispatchEx_iface, pctinfo);
256 return IDispatchEx_GetTypeInfo(&
This->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
264 return IDispatchEx_GetIDsOfNames(&
This->event_target.dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
273 return IDispatchEx_Invoke(&
This->event_target.dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
274 pDispParams, pVarResult, pExcepInfo, puArgErr);
287 nsres = nsIXMLHttpRequest_GetReadyState(
This->nsxhr, &
val);
289 ERR(
"nsIXMLHttpRequest_GetReadyState failed: %08x\n", nsres);
315 nsres = nsIXMLHttpRequest_GetResponseText(
This->nsxhr, &nsstr);
336 nsres = nsIXMLHttpRequest_GetStatus(
This->nsxhr, &
val);
338 ERR(
"nsIXMLHttpRequest_GetStatus failed: %08x\n", nsres);
361 hres = IHTMLXMLHttpRequest_get_readyState(iface, &
state);
371 nsres = nsIXMLHttpRequest_GetStatusText(
This->nsxhr, &nscstr);
400 nsres = nsIXMLHttpRequest_SlowAbort(
This->nsxhr);
402 ERR(
"nsIXMLHttpRequest_SlowAbort failed: %08x\n", nsres);
429 FIXME(
"Synchronous request is not supported yet\n");
465 ERR(
"nsIXMLHttpRequest_Open failed: %08x\n", nsres);
479 switch(
V_VT(&varBody)) {
489 nsres = nsIXMLHttpRequest_Send(
This->nsxhr,
NULL);
492 ERR(
"nsIXMLHttpRequest_Send failed: %08x\n", nsres);
512 hres = IHTMLXMLHttpRequest_get_readyState(iface, &
state);
522 nsres = nsIXMLHttpRequest_GetAllResponseHeaders(
This->nsxhr, &nscstr);
541 hres = IHTMLXMLHttpRequest_get_readyState(iface, &
state);
554 nsres = nsIXMLHttpRequest_GetResponseHeader(
This->nsxhr, &
header, &
ret);
604 static const WCHAR readystatechangeW[] = {
'r',
'e',
'a',
'd',
'y',
's',
't',
'a',
't',
'e',
'c',
'h',
'a',
'n',
'g',
'e',0};
610 if(
This->event_listener)
614 if(!
This->event_listener)
618 This->event_listener->ref = 1;
621 nsres = nsIXMLHttpRequest_QueryInterface(
This->nsxhr, &IID_nsIDOMEventTarget, (
void**)&nstarget);
625 nsres = nsIDOMEventTarget_AddEventListener(nstarget, &type_str, &
This->event_listener->nsIDOMEventListener_iface,
FALSE,
TRUE, 2);
627 nsIDOMEventTarget_Release(nstarget);
629 ERR(
"AddEventListener failed: %08x\n", nsres);
642 IHTMLXMLHttpRequest_tid,
647 DispHTMLXMLHttpRequest_tid,
666 *
ppv = &
This->IHTMLXMLHttpRequestFactory_iface;
668 *
ppv = &
This->IHTMLXMLHttpRequestFactory_iface;
670 *
ppv = &
This->IHTMLXMLHttpRequestFactory_iface;
711 return IDispatchEx_GetTypeInfoCount(&
This->dispex.IDispatchEx_iface, pctinfo);
719 return IDispatchEx_GetTypeInfo(&
This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
727 return IDispatchEx_GetIDsOfNames(&
This->dispex.IDispatchEx_iface,
riid, rgszNames, cNames,
736 return IDispatchEx_Invoke(&
This->dispex.IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
737 pDispParams, pVarResult, pExcepInfo, puArgErr);
752 ret = heap_alloc_zero(
sizeof(*
ret));
754 nsIXMLHttpRequest_Release(nsxhr);
764 *
p = &
ret->IHTMLXMLHttpRequest_iface;
780 IHTMLXMLHttpRequestFactory_tid,
785 IHTMLXMLHttpRequestFactory_tid,
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
void user(int argc, const char *argv[])
#define MultiByteToWideChar
const char * debugstr_mshtml_guid(const GUID *iid)
static HRESULT WINAPI HTMLXMLHttpRequest_getResponseHeader(IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR *p)
static HRESULT WINAPI HTMLXMLHttpRequest_getAllResponseHeaders(IHTMLXMLHttpRequest *iface, BSTR *p)
static ULONG WINAPI HTMLXMLHttpRequest_Release(IHTMLXMLHttpRequest *iface)
static nsrefcnt NSAPI XMLHttpReqEventListener_AddRef(nsIDOMEventListener *iface)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo(IHTMLXMLHttpRequestFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static HRESULT WINAPI HTMLXMLHttpRequest_setRequestHeader(IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR bstrValue)
HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow *window, HTMLXMLHttpRequestFactory **ret_ptr)
static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex
static dispex_static_data_t HTMLXMLHttpRequest_dispex
static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef(IHTMLXMLHttpRequestFactory *iface)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfoCount(IHTMLXMLHttpRequestFactory *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLXMLHttpRequest_send(IHTMLXMLHttpRequest *iface, VARIANT varBody)
static HRESULT WINAPI HTMLXMLHttpRequest_GetIDsOfNames(IHTMLXMLHttpRequest *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI HTMLXMLHttpRequest_get_status(IHTMLXMLHttpRequest *iface, LONG *p)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames(IHTMLXMLHttpRequestFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static void detach_xhr_event_listener(XMLHttpReqEventListener *event_listener)
static HRESULT WINAPI HTMLXMLHttpRequest_open(IHTMLXMLHttpRequest *iface, BSTR bstrMethod, BSTR bstrUrl, VARIANT varAsync, VARIANT varUser, VARIANT varPassword)
static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT v)
static HRESULT WINAPI HTMLXMLHttpRequest_Invoke(IHTMLXMLHttpRequest *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static nsresult NSAPI XMLHttpReqEventListener_QueryInterface(nsIDOMEventListener *iface, nsIIDRef riid, void **result)
static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface(IHTMLXMLHttpRequest *iface, REFIID riid, void **ppv)
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfoCount(IHTMLXMLHttpRequest *iface, UINT *pctinfo)
static ULONG WINAPI HTMLXMLHttpRequestFactory_Release(IHTMLXMLHttpRequestFactory *iface)
static HRESULT bstr_to_nsacstr(BSTR bstr, nsACString *str)
static HRESULT WINAPI HTMLXMLHttpRequest_abort(IHTMLXMLHttpRequest *iface)
static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText(IHTMLXMLHttpRequest *iface, BSTR *p)
static const IHTMLXMLHttpRequestVtbl HTMLXMLHttpRequestVtbl
static const tid_t HTMLXMLHttpRequest_iface_tids[]
static const tid_t HTMLXMLHttpRequestFactory_iface_tids[]
static HRESULT WINAPI HTMLXMLHttpRequest_get_readyState(IHTMLXMLHttpRequest *iface, LONG *p)
static HRESULT variant_to_nsastr(VARIANT var, nsAString *ret)
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *iface, IDispatch **p)
static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, int eid)
static ULONG WINAPI HTMLXMLHttpRequest_AddRef(IHTMLXMLHttpRequest *iface)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactory *iface, IHTMLXMLHttpRequest **p)
static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl
static XMLHttpReqEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfo(IHTMLXMLHttpRequest *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static nsrefcnt NSAPI XMLHttpReqEventListener_Release(nsIDOMEventListener *iface)
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
static const nsIDOMEventListenerVtbl XMLHttpReqEventListenerVtbl
static HTMLXMLHttpRequest * impl_from_DispatchEx(DispatchEx *iface)
static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseBody(IHTMLXMLHttpRequest *iface, VARIANT *p)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_Invoke(IHTMLXMLHttpRequestFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT *p)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface(IHTMLXMLHttpRequestFactory *iface, REFIID riid, void **ppv)
static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p)
static nsresult NSAPI XMLHttpReqEventListener_HandleEvent(nsIDOMEventListener *iface, nsIDOMEvent *event)
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText(IHTMLXMLHttpRequest *iface, BSTR *p)
static const WCHAR readystatechangeW[]
HRESULT get_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTarget *event_target, ConnectionPointContainer *cp_container, eventid_t eid, IDispatch *this_obj)
HRESULT set_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
@ EVENTID_READYSTATECHANGE
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
static const char * debugstr_variant(const VARIANT *var)
static IHTMLWindow2 * window
static VARIANTARG static DISPID
void release_dispex(DispatchEx *This)
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
void nsACString_Finish(nsACString *) DECLSPEC_HIDDEN
void nsACString_InitDepend(nsACString *, const char *) DECLSPEC_HIDDEN
nsIXMLHttpRequest * create_nsxhr(nsIDOMWindow *nswindow) DECLSPEC_HIDDEN
static char * heap_strdupWtoU(const WCHAR *str)
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
UINT32 nsACString_GetData(const nsACString *, const char **) DECLSPEC_HIDDEN
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IsEqualGUID(rguid1, rguid2)
IHTMLXMLHttpRequest IHTMLXMLHttpRequest_iface
XMLHttpReqEventListener * event_listener
nsIXMLHttpRequest * nsxhr
nsIDOMEventListener nsIDOMEventListener_iface
#define CONTAINING_RECORD(address, type, field)
_In_ DWORD _Out_ _In_ WORD wFlags