ReactOS  0.4.15-dev-313-g8fde48b
xmlhttprequest.c File Reference
#include "mshtml_private.h"
Include dependency graph for xmlhttprequest.c:

Go to the source code of this file.

Classes

struct  HTMLXMLHttpRequest
 
struct  XMLHttpReqEventListener
 

Typedefs

typedef struct XMLHttpReqEventListener XMLHttpReqEventListener
 

Functions

static HRESULT bstr_to_nsacstr (BSTR bstr, nsACString *str)
 
static HRESULT variant_to_nsastr (VARIANT var, nsAString *ret)
 
static HRESULT return_nscstr (nsresult nsres, nsACString *nscstr, BSTR *p)
 
static void detach_xhr_event_listener (XMLHttpReqEventListener *event_listener)
 
static XMLHttpReqEventListenerimpl_from_nsIDOMEventListener (nsIDOMEventListener *iface)
 
static nsresult NSAPI XMLHttpReqEventListener_QueryInterface (nsIDOMEventListener *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI XMLHttpReqEventListener_AddRef (nsIDOMEventListener *iface)
 
static nsrefcnt NSAPI XMLHttpReqEventListener_Release (nsIDOMEventListener *iface)
 
static nsresult NSAPI XMLHttpReqEventListener_HandleEvent (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static HTMLXMLHttpRequestimpl_from_IHTMLXMLHttpRequest (IHTMLXMLHttpRequest *iface)
 
static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface (IHTMLXMLHttpRequest *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLXMLHttpRequest_AddRef (IHTMLXMLHttpRequest *iface)
 
static ULONG WINAPI HTMLXMLHttpRequest_Release (IHTMLXMLHttpRequest *iface)
 
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfoCount (IHTMLXMLHttpRequest *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfo (IHTMLXMLHttpRequest *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLXMLHttpRequest_GetIDsOfNames (IHTMLXMLHttpRequest *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI HTMLXMLHttpRequest_Invoke (IHTMLXMLHttpRequest *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_readyState (IHTMLXMLHttpRequest *iface, LONG *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseBody (IHTMLXMLHttpRequest *iface, VARIANT *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText (IHTMLXMLHttpRequest *iface, BSTR *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML (IHTMLXMLHttpRequest *iface, IDispatch **p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_status (IHTMLXMLHttpRequest *iface, LONG *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText (IHTMLXMLHttpRequest *iface, BSTR *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange (IHTMLXMLHttpRequest *iface, VARIANT v)
 
static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange (IHTMLXMLHttpRequest *iface, VARIANT *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_abort (IHTMLXMLHttpRequest *iface)
 
static HRESULT WINAPI HTMLXMLHttpRequest_open (IHTMLXMLHttpRequest *iface, BSTR bstrMethod, BSTR bstrUrl, VARIANT varAsync, VARIANT varUser, VARIANT varPassword)
 
static HRESULT WINAPI HTMLXMLHttpRequest_send (IHTMLXMLHttpRequest *iface, VARIANT varBody)
 
static HRESULT WINAPI HTMLXMLHttpRequest_getAllResponseHeaders (IHTMLXMLHttpRequest *iface, BSTR *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_getResponseHeader (IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR *p)
 
static HRESULT WINAPI HTMLXMLHttpRequest_setRequestHeader (IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR bstrValue)
 
static HTMLXMLHttpRequestimpl_from_DispatchEx (DispatchEx *iface)
 
static void HTMLXMLHttpRequest_bind_event (DispatchEx *dispex, int eid)
 
static HTMLXMLHttpRequestFactoryimpl_from_IHTMLXMLHttpRequestFactory (IHTMLXMLHttpRequestFactory *iface)
 
static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface (IHTMLXMLHttpRequestFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef (IHTMLXMLHttpRequestFactory *iface)
 
static ULONG WINAPI HTMLXMLHttpRequestFactory_Release (IHTMLXMLHttpRequestFactory *iface)
 
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfoCount (IHTMLXMLHttpRequestFactory *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo (IHTMLXMLHttpRequestFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames (IHTMLXMLHttpRequestFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
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 HTMLXMLHttpRequestFactory_create (IHTMLXMLHttpRequestFactory *iface, IHTMLXMLHttpRequest **p)
 
HRESULT HTMLXMLHttpRequestFactory_Create (HTMLInnerWindow *window, HTMLXMLHttpRequestFactory **ret_ptr)
 

Variables

static const nsIDOMEventListenerVtbl XMLHttpReqEventListenerVtbl
 
static const IHTMLXMLHttpRequestVtbl HTMLXMLHttpRequestVtbl
 
static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl
 
static const tid_t HTMLXMLHttpRequest_iface_tids []
 
static dispex_static_data_t HTMLXMLHttpRequest_dispex
 
static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl
 
static const tid_t HTMLXMLHttpRequestFactory_iface_tids []
 
static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex
 

Typedef Documentation

◆ XMLHttpReqEventListener

Function Documentation

◆ bstr_to_nsacstr()

static HRESULT bstr_to_nsacstr ( BSTR  bstr,
nsACString str 
)
static

Definition at line 21 of file xmlhttprequest.c.

22 {
23  char *cstr = heap_strdupWtoU(bstr);
24  if(!cstr)
25  return E_OUTOFMEMORY;
26  nsACString_Init(str, cstr);
27  heap_free(cstr);
28  return S_OK;
29 }
BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN
Definition: nsembed.c:788
static char * heap_strdupWtoU(const WCHAR *str)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
#define S_OK
Definition: intsafe.h:59
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HTMLXMLHttpRequest_open().

◆ detach_xhr_event_listener()

static void detach_xhr_event_listener ( XMLHttpReqEventListener event_listener)
static

Definition at line 93 of file xmlhttprequest.c.

94 {
95  nsIDOMEventTarget *event_target;
96  nsAString str;
97  nsresult nsres;
98 
99  static const WCHAR readystatechangeW[] =
100  {'o','n','r','e','a','d','y','s','t','a','t','e','c','h','a','n','g','e',0};
101 
102  nsres = nsIXMLHttpRequest_QueryInterface(event_listener->xhr->nsxhr, &IID_nsIDOMEventTarget, (void**)&event_target);
103  assert(nsres == NS_OK);
104 
106  nsres = nsIDOMEventTarget_RemoveEventListener(event_target, &str, &event_listener->nsIDOMEventListener_iface, FALSE);
108  nsIDOMEventTarget_Release(event_target);
109 
110  event_listener->xhr->event_listener = NULL;
111  event_listener->xhr = NULL;
112  nsIDOMEventListener_Release(&event_listener->nsIDOMEventListener_iface);
113 }
static const WCHAR readystatechangeW[]
Definition: htmlevent.c:106
HTMLXMLHttpRequest * xhr
#define assert(x)
Definition: debug.h:53
#define NS_OK
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
nsIDOMEventListener nsIDOMEventListener_iface
HRESULT nsresult
Definition: nsiface.idl:39
nsIXMLHttpRequest * nsxhr
XMLHttpReqEventListener * event_listener

Referenced by HTMLXMLHttpRequest_Release().

◆ HTMLXMLHttpRequest_abort()

static HRESULT WINAPI HTMLXMLHttpRequest_abort ( IHTMLXMLHttpRequest *  iface)
static

Definition at line 393 of file xmlhttprequest.c.

394 {
396  nsresult nsres;
397 
398  TRACE("(%p)->()\n", This);
399 
400  nsres = nsIXMLHttpRequest_SlowAbort(This->nsxhr);
401  if(NS_FAILED(nsres)) {
402  ERR("nsIXMLHttpRequest_SlowAbort failed: %08x\n", nsres);
403  return E_FAIL;
404  }
405 
406  return S_OK;
407 }
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLXMLHttpRequest_AddRef()

static ULONG WINAPI HTMLXMLHttpRequest_AddRef ( IHTMLXMLHttpRequest *  iface)
static

Definition at line 217 of file xmlhttprequest.c.

218 {
221 
222  TRACE("(%p) ref=%d\n", This, ref);
223 
224  return ref;
225 }
Definition: send.c:48
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ HTMLXMLHttpRequest_bind_event()

static void HTMLXMLHttpRequest_bind_event ( DispatchEx dispex,
int  eid 
)
static

Definition at line 597 of file xmlhttprequest.c.

598 {
600  nsIDOMEventTarget *nstarget;
601  nsAString type_str;
602  nsresult nsres;
603 
604  static const WCHAR readystatechangeW[] = {'r','e','a','d','y','s','t','a','t','e','c','h','a','n','g','e',0};
605 
606  TRACE("(%p)\n", This);
607 
609 
610  if(This->event_listener)
611  return;
612 
613  This->event_listener = heap_alloc(sizeof(*This->event_listener));
614  if(!This->event_listener)
615  return;
616 
617  This->event_listener->nsIDOMEventListener_iface.lpVtbl = &XMLHttpReqEventListenerVtbl;
618  This->event_listener->ref = 1;
619  This->event_listener->xhr = This;
620 
621  nsres = nsIXMLHttpRequest_QueryInterface(This->nsxhr, &IID_nsIDOMEventTarget, (void**)&nstarget);
622  assert(nsres == NS_OK);
623 
625  nsres = nsIDOMEventTarget_AddEventListener(nstarget, &type_str, &This->event_listener->nsIDOMEventListener_iface, FALSE, TRUE, 2);
626  nsAString_Finish(&type_str);
627  nsIDOMEventTarget_Release(nstarget);
628  if(NS_FAILED(nsres))
629  ERR("AddEventListener failed: %08x\n", nsres);
630 }
#define TRUE
Definition: types.h:120
static const nsIDOMEventListenerVtbl XMLHttpReqEventListenerVtbl
static const WCHAR readystatechangeW[]
Definition: htmlevent.c:106
#define assert(x)
Definition: debug.h:53
static HTMLXMLHttpRequest * impl_from_DispatchEx(DispatchEx *iface)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define NS_OK
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ERR(fmt,...)
Definition: debug.h:110
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLXMLHttpRequest_get_onreadystatechange()

static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange ( IHTMLXMLHttpRequest *  iface,
VARIANT p 
)
static

Definition at line 384 of file xmlhttprequest.c.

385 {
387 
388  TRACE("(%p)->(%p)\n", This, p);
389 
390  return get_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, p);
391 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT get_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
Definition: htmlevent.c:1447
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLXMLHttpRequest_get_readyState()

static HRESULT WINAPI HTMLXMLHttpRequest_get_readyState ( IHTMLXMLHttpRequest *  iface,
LONG p 
)
static

Definition at line 277 of file xmlhttprequest.c.

278 {
280  UINT16 val;
281  nsresult nsres;
282 
283  TRACE("(%p)->(%p)\n", This, p);
284 
285  if(!p)
286  return E_POINTER;
287  nsres = nsIXMLHttpRequest_GetReadyState(This->nsxhr, &val);
288  if(NS_FAILED(nsres)) {
289  ERR("nsIXMLHttpRequest_GetReadyState failed: %08x\n", nsres);
290  return E_FAIL;
291  }
292  *p = val;
293  return S_OK;
294 }
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
GLuint GLfloat * val
Definition: glext.h:7180
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
unsigned short UINT16
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLXMLHttpRequest_get_responseBody()

static HRESULT WINAPI HTMLXMLHttpRequest_get_responseBody ( IHTMLXMLHttpRequest *  iface,
VARIANT p 
)
static

Definition at line 296 of file xmlhttprequest.c.

297 {
299  FIXME("(%p)->(%p)\n", This, p);
300  return E_NOTIMPL;
301 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLXMLHttpRequest_get_responseText()

static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText ( IHTMLXMLHttpRequest *  iface,
BSTR p 
)
static

Definition at line 303 of file xmlhttprequest.c.

304 {
306  nsAString nsstr;
307  nsresult nsres;
308 
309  TRACE("(%p)->(%p)\n", This, p);
310 
311  if(!p)
312  return E_POINTER;
313 
314  nsAString_Init(&nsstr, NULL);
315  nsres = nsIXMLHttpRequest_GetResponseText(This->nsxhr, &nsstr);
316  return return_nsstr(nsres, &nsstr, p);
317 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
smooth NULL
Definition: ftsmooth.c:416
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
#define TRACE(s)
Definition: solgame.cpp:4
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLXMLHttpRequest_get_responseXML()

static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML ( IHTMLXMLHttpRequest *  iface,
IDispatch **  p 
)
static

Definition at line 319 of file xmlhttprequest.c.

320 {
322  FIXME("(%p)->(%p)\n", This, p);
323  return E_NOTIMPL;
324 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLXMLHttpRequest_get_status()

static HRESULT WINAPI HTMLXMLHttpRequest_get_status ( IHTMLXMLHttpRequest *  iface,
LONG p 
)
static

Definition at line 326 of file xmlhttprequest.c.

327 {
329  DWORD val;
330  nsresult nsres;
331  TRACE("(%p)->(%p)\n", This, p);
332 
333  if(!p)
334  return E_POINTER;
335 
336  nsres = nsIXMLHttpRequest_GetStatus(This->nsxhr, &val);
337  if(NS_FAILED(nsres)) {
338  ERR("nsIXMLHttpRequest_GetStatus failed: %08x\n", nsres);
339  return E_FAIL;
340  }
341  *p = val;
342  if(val == 0)
343  return E_FAIL; /* WinAPI thinks this is an error */
344 
345  return S_OK;
346 }
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
GLuint GLfloat * val
Definition: glext.h:7180
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLXMLHttpRequest_get_statusText()

static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText ( IHTMLXMLHttpRequest *  iface,
BSTR p 
)
static

Definition at line 348 of file xmlhttprequest.c.

349 {
351  nsACString nscstr;
352  nsresult nsres;
353  HRESULT hres;
354  LONG state;
355 
356  TRACE("(%p)->(%p)\n", This, p);
357 
358  if(!p)
359  return E_POINTER;
360 
361  hres = IHTMLXMLHttpRequest_get_readyState(iface, &state);
362  if(FAILED(hres))
363  return hres;
364 
365  if(state < 2) {
366  *p = NULL;
367  return E_FAIL;
368  }
369 
370  nsACString_Init(&nscstr, NULL);
371  nsres = nsIXMLHttpRequest_GetStatusText(This->nsxhr, &nscstr);
372  return return_nscstr(nsres, &nscstr, p);
373 }
static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p)
BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN
Definition: nsembed.c:788
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
static int state
Definition: maze.c:121
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLXMLHttpRequest_getAllResponseHeaders()

static HRESULT WINAPI HTMLXMLHttpRequest_getAllResponseHeaders ( IHTMLXMLHttpRequest *  iface,
BSTR p 
)
static

Definition at line 499 of file xmlhttprequest.c.

500 {
502  nsACString nscstr;
503  nsresult nsres;
504  HRESULT hres;
505  LONG state;
506 
507  TRACE("(%p)->(%p)\n", This, p);
508 
509  if(!p)
510  return E_POINTER;
511 
512  hres = IHTMLXMLHttpRequest_get_readyState(iface, &state);
513  if(FAILED(hres))
514  return hres;
515 
516  if(state < 2) {
517  *p = NULL;
518  return E_FAIL;
519  }
520 
521  nsACString_Init(&nscstr, NULL);
522  nsres = nsIXMLHttpRequest_GetAllResponseHeaders(This->nsxhr, &nscstr);
523  return return_nscstr(nsres, &nscstr, p);
524 }
static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p)
BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN
Definition: nsembed.c:788
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
static int state
Definition: maze.c:121
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365

◆ HTMLXMLHttpRequest_GetIDsOfNames()

static HRESULT WINAPI HTMLXMLHttpRequest_GetIDsOfNames ( IHTMLXMLHttpRequest *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 259 of file xmlhttprequest.c.

261 {
263 
264  return IDispatchEx_GetIDsOfNames(&This->event_target.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
265  lcid, rgDispId);
266 }
REFIID riid
Definition: precomp.h:44
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)

◆ HTMLXMLHttpRequest_getResponseHeader()

static HRESULT WINAPI HTMLXMLHttpRequest_getResponseHeader ( IHTMLXMLHttpRequest *  iface,
BSTR  bstrHeader,
BSTR p 
)
static

Definition at line 526 of file xmlhttprequest.c.

527 {
530  char *cstr;
531  nsresult nsres;
532  HRESULT hres;
533  LONG state;
534  TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrHeader), p);
535 
536  if(!p)
537  return E_POINTER;
538  if(!bstrHeader)
539  return E_INVALIDARG;
540 
541  hres = IHTMLXMLHttpRequest_get_readyState(iface, &state);
542  if(FAILED(hres))
543  return hres;
544 
545  if(state < 2) {
546  *p = NULL;
547  return E_FAIL;
548  }
549 
550  cstr = heap_strdupWtoU(bstrHeader);
553 
554  nsres = nsIXMLHttpRequest_GetResponseHeader(This->nsxhr, &header, &ret);
555 
557  heap_free(cstr);
558  return return_nscstr(nsres, &ret, p);
559 }
static HRESULT return_nscstr(nsresult nsres, nsACString *nscstr, BSTR *p)
BOOL nsACString_Init(nsACString *str, const char *data) DECLSPEC_HIDDEN
Definition: nsembed.c:788
static char * heap_strdupWtoU(const WCHAR *str)
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
int ret
static int state
Definition: maze.c:121
void nsACString_InitDepend(nsACString *, const char *) DECLSPEC_HIDDEN
Definition: nsembed.c:797
void nsACString_Finish(nsACString *) DECLSPEC_HIDDEN
Definition: nsembed.c:812
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902
#define E_POINTER
Definition: winerror.h:2365
struct CFHEADER header
Definition: fdi.c:101
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HTMLXMLHttpRequest_GetTypeInfo()

static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfo ( IHTMLXMLHttpRequest *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 251 of file xmlhttprequest.c.

253 {
255 
256  return IDispatchEx_GetTypeInfo(&This->event_target.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
257 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)

◆ HTMLXMLHttpRequest_GetTypeInfoCount()

static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfoCount ( IHTMLXMLHttpRequest *  iface,
UINT pctinfo 
)
static

Definition at line 245 of file xmlhttprequest.c.

246 {
248  return IDispatchEx_GetTypeInfoCount(&This->event_target.dispex.IDispatchEx_iface, pctinfo);
249 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)

◆ HTMLXMLHttpRequest_Invoke()

static HRESULT WINAPI HTMLXMLHttpRequest_Invoke ( IHTMLXMLHttpRequest *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 268 of file xmlhttprequest.c.

270 {
272 
273  return IDispatchEx_Invoke(&This->event_target.dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
274  pDispParams, pVarResult, pExcepInfo, puArgErr);
275 }
REFIID riid
Definition: precomp.h:44
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534

◆ HTMLXMLHttpRequest_open()

static HRESULT WINAPI HTMLXMLHttpRequest_open ( IHTMLXMLHttpRequest *  iface,
BSTR  bstrMethod,
BSTR  bstrUrl,
VARIANT  varAsync,
VARIANT  varUser,
VARIANT  varPassword 
)
static

Definition at line 409 of file xmlhttprequest.c.

410 {
414  nsresult nsres;
415  HRESULT hres;
416 
417  TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(bstrMethod), debugstr_w(bstrUrl), debugstr_variant(&varAsync), debugstr_variant(&varUser), debugstr_variant(&varPassword));
418 
419  if(V_VT(&varAsync) != VT_BOOL) {
420  FIXME("varAsync not supported: %s\n", debugstr_variant(&varAsync));
421  return E_FAIL;
422  }
423 
424  /* Note: Starting with Gecko 30.0 (Firefox 30.0 / Thunderbird 30.0 / SeaMonkey 2.27),
425  * synchronous requests on the main thread have been deprecated due to the negative
426  * effects to the user experience.
427  */
428  if(!V_BOOL(&varAsync)) {
429  FIXME("Synchronous request is not supported yet\n");
430  return E_FAIL;
431  }
432 
433  hres = variant_to_nsastr(varUser, &user);
434  if(FAILED(hres))
435  return hres;
436  hres = variant_to_nsastr(varPassword, &password);
437  if(FAILED(hres)) {
439  return hres;
440  }
441 
442  hres = bstr_to_nsacstr(bstrMethod, &method);
443  if(FAILED(hres)) {
446  return hres;
447  }
448  hres = bstr_to_nsacstr(bstrUrl, &url);
449  if(FAILED(hres)) {
453  return hres;
454  }
455 
456  nsres = nsIXMLHttpRequest_Open(This->nsxhr, &method, &url, TRUE,
457  &user, &password, 0);
458 
463 
464  if(NS_FAILED(nsres)) {
465  ERR("nsIXMLHttpRequest_Open failed: %08x\n", nsres);
466  return E_FAIL;
467  }
468 
469  return S_OK;
470 }
#define TRUE
Definition: types.h:120
static HRESULT variant_to_nsastr(VARIANT var, nsAString *ret)
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
static HRESULT bstr_to_nsacstr(BSTR bstr, nsACString *str)
LONG HRESULT
Definition: typedefs.h:78
static const WCHAR url[]
Definition: encode.c:1432
#define V_BOOL(A)
Definition: oleauto.h:224
method
Definition: dragdrop.c:53
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
#define V_VT(A)
Definition: oleauto.h:211
#define ERR(fmt,...)
Definition: debug.h:110
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
void nsACString_Finish(nsACString *) DECLSPEC_HIDDEN
Definition: nsembed.c:812
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39
void user(int argc, const char *argv[])
Definition: cmds.c:1350

◆ HTMLXMLHttpRequest_put_onreadystatechange()

static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange ( IHTMLXMLHttpRequest *  iface,
VARIANT  v 
)
static

Definition at line 375 of file xmlhttprequest.c.

376 {
378 
379  TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
380 
381  return set_event_handler(&This->event_target, EVENTID_READYSTATECHANGE, &v);
382 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
HRESULT set_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
Definition: htmlevent.c:1404
#define TRACE(s)
Definition: solgame.cpp:4
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
const GLdouble * v
Definition: gl.h:2040

◆ HTMLXMLHttpRequest_QueryInterface()

static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface ( IHTMLXMLHttpRequest *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 193 of file xmlhttprequest.c.

194 {
196 
197  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
198 
199  if(IsEqualGUID(&IID_IUnknown, riid)) {
200  *ppv = &This->IHTMLXMLHttpRequest_iface;
201  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
202  *ppv = &This->IHTMLXMLHttpRequest_iface;
203  }else if(IsEqualGUID(&IID_IHTMLXMLHttpRequest, riid)) {
204  *ppv = &This->IHTMLXMLHttpRequest_iface;
205  }else if(dispex_query_interface(&This->event_target.dispex, riid, ppv)) {
206  return *ppv ? S_OK : E_NOINTERFACE;
207  }else {
208  *ppv = NULL;
209  WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
210  return E_NOINTERFACE;
211  }
212 
213  IUnknown_AddRef((IUnknown*)*ppv);
214  return S_OK;
215 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HTMLXMLHttpRequest_Release()

static ULONG WINAPI HTMLXMLHttpRequest_Release ( IHTMLXMLHttpRequest *  iface)
static

Definition at line 227 of file xmlhttprequest.c.

228 {
231 
232  TRACE("(%p) ref=%d\n", This, ref);
233 
234  if(!ref) {
235  if(This->event_listener)
236  detach_xhr_event_listener(This->event_listener);
237  release_dispex(&This->event_target.dispex);
238  nsIXMLHttpRequest_Release(This->nsxhr);
239  heap_free(This);
240  }
241 
242  return ref;
243 }
static void detach_xhr_event_listener(XMLHttpReqEventListener *event_listener)
Definition: send.c:48
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
void release_dispex(DispatchEx *This)
Definition: dispex.c:1706
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HTMLXMLHttpRequest_send()

static HRESULT WINAPI HTMLXMLHttpRequest_send ( IHTMLXMLHttpRequest *  iface,
VARIANT  varBody 
)
static

Definition at line 472 of file xmlhttprequest.c.

473 {
475  nsresult nsres;
476 
477  TRACE("(%p)->(%s)\n", This, debugstr_variant(&varBody));
478 
479  switch(V_VT(&varBody)) {
480  case VT_NULL:
481  case VT_EMPTY:
482  case VT_ERROR:
483  break;
484  default:
485  FIXME("varBody(%s) unsupported\n", debugstr_variant(&varBody));
486  return E_FAIL;
487  }
488 
489  nsres = nsIXMLHttpRequest_Send(This->nsxhr, NULL);
490 
491  if(NS_FAILED(nsres)) {
492  ERR("nsIXMLHttpRequest_Send failed: %08x\n", nsres);
493  return E_FAIL;
494  }
495 
496  return S_OK;
497 }
#define E_FAIL
Definition: ddrawi.h:102
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define V_VT(A)
Definition: oleauto.h:211
#define ERR(fmt,...)
Definition: debug.h:110
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLXMLHttpRequest_setRequestHeader()

static HRESULT WINAPI HTMLXMLHttpRequest_setRequestHeader ( IHTMLXMLHttpRequest *  iface,
BSTR  bstrHeader,
BSTR  bstrValue 
)
static

Definition at line 561 of file xmlhttprequest.c.

562 {
564  FIXME("(%p)->(%s %s)\n", This, debugstr_w(bstrHeader), debugstr_w(bstrValue));
565  return E_NOTIMPL;
566 }
static HTMLXMLHttpRequest * impl_from_IHTMLXMLHttpRequest(IHTMLXMLHttpRequest *iface)
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLXMLHttpRequestFactory_AddRef()

static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef ( IHTMLXMLHttpRequestFactory *  iface)
static

Definition at line 683 of file xmlhttprequest.c.

684 {
687 
688  TRACE("(%p) ref=%d\n", This, ref);
689 
690  return ref;
691 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ HTMLXMLHttpRequestFactory_create()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_create ( IHTMLXMLHttpRequestFactory *  iface,
IHTMLXMLHttpRequest **  p 
)
static

Definition at line 740 of file xmlhttprequest.c.

741 {
744  nsIXMLHttpRequest *nsxhr;
745 
746  TRACE("(%p)->(%p)\n", This, p);
747 
748  nsxhr = create_nsxhr(This->window->base.outer_window->nswindow);
749  if(!nsxhr)
750  return E_FAIL;
751 
752  ret = heap_alloc_zero(sizeof(*ret));
753  if(!ret) {
754  nsIXMLHttpRequest_Release(nsxhr);
755  return E_OUTOFMEMORY;
756  }
757  ret->nsxhr = nsxhr;
758 
759  ret->IHTMLXMLHttpRequest_iface.lpVtbl = &HTMLXMLHttpRequestVtbl;
760  init_dispex(&ret->event_target.dispex, (IUnknown*)&ret->IHTMLXMLHttpRequest_iface,
762  ret->ref = 1;
763 
764  *p = &ret->IHTMLXMLHttpRequest_iface;
765  return S_OK;
766 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
nsIXMLHttpRequest * create_nsxhr(nsIDOMWindow *nswindow) DECLSPEC_HIDDEN
Definition: nsembed.c:2156
static dispex_static_data_t HTMLXMLHttpRequest_dispex
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define S_OK
Definition: intsafe.h:59
static const IHTMLXMLHttpRequestVtbl HTMLXMLHttpRequestVtbl
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLXMLHttpRequestFactory_Create()

HRESULT HTMLXMLHttpRequestFactory_Create ( HTMLInnerWindow window,
HTMLXMLHttpRequestFactory **  ret_ptr 
)

Definition at line 790 of file xmlhttprequest.c.

791 {
793 
794  ret = heap_alloc(sizeof(*ret));
795  if(!ret)
796  return E_OUTOFMEMORY;
797 
798  ret->IHTMLXMLHttpRequestFactory_iface.lpVtbl = &HTMLXMLHttpRequestFactoryVtbl;
799  ret->ref = 1;
800  ret->window = window;
801 
802  init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLXMLHttpRequestFactory_iface,
804 
805  *ret_ptr = ret;
806  return S_OK;
807 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
int ret
static IHTMLWindow2 * window
Definition: events.c:77
#define S_OK
Definition: intsafe.h:59
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex
static const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl

Referenced by HTMLWindow5_get_XMLHttpRequest().

◆ HTMLXMLHttpRequestFactory_GetIDsOfNames()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames ( IHTMLXMLHttpRequestFactory *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 722 of file xmlhttprequest.c.

724 {
726 
727  return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames,
728  lcid, rgDispId);
729 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
REFIID riid
Definition: precomp.h:44

◆ HTMLXMLHttpRequestFactory_GetTypeInfo()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo ( IHTMLXMLHttpRequestFactory *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 714 of file xmlhttprequest.c.

716 {
718 
719  return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
720 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)

◆ HTMLXMLHttpRequestFactory_GetTypeInfoCount()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfoCount ( IHTMLXMLHttpRequestFactory *  iface,
UINT pctinfo 
)
static

Definition at line 708 of file xmlhttprequest.c.

709 {
711  return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
712 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)

◆ HTMLXMLHttpRequestFactory_Invoke()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_Invoke ( IHTMLXMLHttpRequestFactory *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 731 of file xmlhttprequest.c.

733 {
735 
736  return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
737  pDispParams, pVarResult, pExcepInfo, puArgErr);
738 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
REFIID riid
Definition: precomp.h:44
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534

◆ HTMLXMLHttpRequestFactory_QueryInterface()

static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface ( IHTMLXMLHttpRequestFactory *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 659 of file xmlhttprequest.c.

660 {
662 
663  TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
664 
665  if(IsEqualGUID(&IID_IUnknown, riid)) {
666  *ppv = &This->IHTMLXMLHttpRequestFactory_iface;
667  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
668  *ppv = &This->IHTMLXMLHttpRequestFactory_iface;
669  }else if(IsEqualGUID(&IID_IHTMLXMLHttpRequestFactory, riid)) {
670  *ppv = &This->IHTMLXMLHttpRequestFactory_iface;
671  }else if(dispex_query_interface(&This->dispex, riid, ppv)) {
672  return *ppv ? S_OK : E_NOINTERFACE;
673  }else {
674  *ppv = NULL;
675  WARN("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv);
676  return E_NOINTERFACE;
677  }
678 
679  IUnknown_AddRef((IUnknown*)*ppv);
680  return S_OK;
681 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * debugstr_mshtml_guid(const GUID *iid)
Definition: main.c:535
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ HTMLXMLHttpRequestFactory_Release()

static ULONG WINAPI HTMLXMLHttpRequestFactory_Release ( IHTMLXMLHttpRequestFactory *  iface)
static

Definition at line 693 of file xmlhttprequest.c.

694 {
697 
698  TRACE("(%p) ref=%d\n", This, ref);
699 
700  if(!ref) {
701  release_dispex(&This->dispex);
702  heap_free(This);
703  }
704 
705  return ref;
706 }
static HTMLXMLHttpRequestFactory * impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface)
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
void release_dispex(DispatchEx *This)
Definition: dispex.c:1706
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ impl_from_DispatchEx()

static HTMLXMLHttpRequest* impl_from_DispatchEx ( DispatchEx iface)
inlinestatic

Definition at line 592 of file xmlhttprequest.c.

593 {
594  return CONTAINING_RECORD(iface, HTMLXMLHttpRequest, event_target.dispex);
595 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HTMLXMLHttpRequest_bind_event().

◆ impl_from_IHTMLXMLHttpRequest()

◆ impl_from_IHTMLXMLHttpRequestFactory()

static HTMLXMLHttpRequestFactory* impl_from_IHTMLXMLHttpRequestFactory ( IHTMLXMLHttpRequestFactory *  iface)
inlinestatic

Definition at line 654 of file xmlhttprequest.c.

655 {
656  return CONTAINING_RECORD(iface, HTMLXMLHttpRequestFactory, IHTMLXMLHttpRequestFactory_iface);
657 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HTMLXMLHttpRequestFactory_AddRef(), HTMLXMLHttpRequestFactory_create(), HTMLXMLHttpRequestFactory_GetIDsOfNames(), HTMLXMLHttpRequestFactory_GetTypeInfo(), HTMLXMLHttpRequestFactory_GetTypeInfoCount(), HTMLXMLHttpRequestFactory_Invoke(), HTMLXMLHttpRequestFactory_QueryInterface(), and HTMLXMLHttpRequestFactory_Release().

◆ impl_from_nsIDOMEventListener()

static XMLHttpReqEventListener* impl_from_nsIDOMEventListener ( nsIDOMEventListener iface)
inlinestatic

Definition at line 116 of file xmlhttprequest.c.

117 {
118  return CONTAINING_RECORD(iface, XMLHttpReqEventListener, nsIDOMEventListener_iface);
119 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by XMLHttpReqEventListener_AddRef(), XMLHttpReqEventListener_HandleEvent(), XMLHttpReqEventListener_QueryInterface(), and XMLHttpReqEventListener_Release().

◆ return_nscstr()

static HRESULT return_nscstr ( nsresult  nsres,
nsACString nscstr,
BSTR p 
)
static

Definition at line 48 of file xmlhttprequest.c.

49 {
50  const char *str;
51  int len;
52 
53  if(NS_FAILED(nsres)) {
54  ERR("failed: %08x\n", nsres);
55  nsACString_Finish(nscstr);
56  return E_FAIL;
57  }
58 
59  nsACString_GetData(nscstr, &str);
60 
61  if(*str) {
62  len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
64  if(!*p) {
65  nsACString_Finish(nscstr);
66  return E_OUTOFMEMORY;
67  }
68  MultiByteToWideChar(CP_UTF8, 0, str, -1, *p, len);
69  }else {
70  *p = NULL;
71  }
72 
73  nsACString_Finish(nscstr);
74  return S_OK;
75 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
UINT32 nsACString_GetData(const nsACString *, const char **) DECLSPEC_HIDDEN
Definition: nsembed.c:807
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define CP_UTF8
Definition: nls.h:20
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
void nsACString_Finish(nsACString *) DECLSPEC_HIDDEN
Definition: nsembed.c:812
#define MultiByteToWideChar
Definition: compat.h:100
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by HTMLXMLHttpRequest_get_statusText(), HTMLXMLHttpRequest_getAllResponseHeaders(), and HTMLXMLHttpRequest_getResponseHeader().

◆ variant_to_nsastr()

static HRESULT variant_to_nsastr ( VARIANT  var,
nsAString ret 
)
static

Definition at line 31 of file xmlhttprequest.c.

32 {
33  switch(V_VT(&var)) {
34  case VT_NULL:
35  case VT_ERROR:
36  case VT_EMPTY:
38  return S_OK;
39  case VT_BSTR:
41  return S_OK;
42  default:
43  FIXME("Unsupported VARIANT: %s\n", debugstr_variant(&var));
44  return E_INVALIDARG;
45  }
46 }
const char * var
Definition: shader.c:5666
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
int ret
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817

Referenced by HTMLXMLHttpRequest_open().

◆ XMLHttpReqEventListener_AddRef()

static nsrefcnt NSAPI XMLHttpReqEventListener_AddRef ( nsIDOMEventListener iface)
static

Definition at line 142 of file xmlhttprequest.c.

143 {
146 
147  TRACE("(%p) ref=%d\n", This, ref);
148 
149  return ref;
150 }
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static XMLHttpReqEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
#define InterlockedIncrement
Definition: armddk.h:53

◆ XMLHttpReqEventListener_HandleEvent()

static nsresult NSAPI XMLHttpReqEventListener_HandleEvent ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 167 of file xmlhttprequest.c.

168 {
170 
171  TRACE("(%p)\n", This);
172 
173  if(!This->xhr)
174  return NS_OK;
175 
177  (IDispatch*)&This->xhr->IHTMLXMLHttpRequest_iface);
178  return NS_OK;
179 }
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static XMLHttpReqEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTarget *event_target, ConnectionPointContainer *cp_container, eventid_t eid, IDispatch *this_obj)
Definition: htmlevent.c:952

◆ XMLHttpReqEventListener_QueryInterface()

static nsresult NSAPI XMLHttpReqEventListener_QueryInterface ( nsIDOMEventListener iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 121 of file xmlhttprequest.c.

123 {
125 
126  if(IsEqualGUID(&IID_nsISupports, riid)) {
127  TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
128  *result = &This->nsIDOMEventListener_iface;
129  }else if(IsEqualGUID(&IID_nsIDOMEventListener, riid)) {
130  TRACE("(%p)->(IID_nsIDOMEventListener %p)\n", This, result);
131  *result = &This->nsIDOMEventListener_iface;
132  }else {
133  *result = NULL;
134  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
135  return NS_NOINTERFACE;
136  }
137 
138  nsIDOMEventListener_AddRef(&This->nsIDOMEventListener_iface);
139  return NS_OK;
140 }
REFIID riid
Definition: precomp.h:44
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static XMLHttpReqEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
#define NS_NOINTERFACE
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint64EXT * result
Definition: glext.h:11304

◆ XMLHttpReqEventListener_Release()

static nsrefcnt NSAPI XMLHttpReqEventListener_Release ( nsIDOMEventListener iface)
static

Definition at line 152 of file xmlhttprequest.c.

153 {
156 
157  TRACE("(%p) ref=%d\n", This, ref);
158 
159  if(!ref) {
160  assert(!This->xhr);
161  heap_free(This);
162  }
163 
164  return ref;
165 }
#define assert(x)
Definition: debug.h:53
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static XMLHttpReqEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Variable Documentation

◆ HTMLXMLHttpRequest_dispex

dispex_static_data_t HTMLXMLHttpRequest_dispex
static
Initial value:
= {
DispHTMLXMLHttpRequest_tid,
}
static const tid_t HTMLXMLHttpRequest_iface_tids[]
smooth NULL
Definition: ftsmooth.c:416
static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl

Definition at line 645 of file xmlhttprequest.c.

Referenced by HTMLXMLHttpRequestFactory_create().

◆ HTMLXMLHttpRequest_dispex_vtbl

dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl
static
Initial value:
= {
}
static void HTMLXMLHttpRequest_bind_event(DispatchEx *dispex, int eid)
smooth NULL
Definition: ftsmooth.c:416

Definition at line 632 of file xmlhttprequest.c.

◆ HTMLXMLHttpRequest_iface_tids

const tid_t HTMLXMLHttpRequest_iface_tids[]
static
Initial value:
= {
IHTMLXMLHttpRequest_tid,
0
}

Definition at line 641 of file xmlhttprequest.c.

◆ HTMLXMLHttpRequestFactory_dispex

dispex_static_data_t HTMLXMLHttpRequestFactory_dispex
static
Initial value:
= {
IHTMLXMLHttpRequestFactory_tid,
}
smooth NULL
Definition: ftsmooth.c:416
static const tid_t HTMLXMLHttpRequestFactory_iface_tids[]

Definition at line 783 of file xmlhttprequest.c.

Referenced by HTMLXMLHttpRequestFactory_Create().

◆ HTMLXMLHttpRequestFactory_iface_tids

const tid_t HTMLXMLHttpRequestFactory_iface_tids[]
static
Initial value:
= {
IHTMLXMLHttpRequestFactory_tid,
0
}

Definition at line 779 of file xmlhttprequest.c.

◆ HTMLXMLHttpRequestFactoryVtbl

const IHTMLXMLHttpRequestFactoryVtbl HTMLXMLHttpRequestFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactory *iface, IHTMLXMLHttpRequest **p)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfoCount(IHTMLXMLHttpRequestFactory *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetIDsOfNames(IHTMLXMLHttpRequestFactory *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static ULONG WINAPI HTMLXMLHttpRequestFactory_Release(IHTMLXMLHttpRequestFactory *iface)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_QueryInterface(IHTMLXMLHttpRequestFactory *iface, REFIID riid, void **ppv)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_GetTypeInfo(IHTMLXMLHttpRequestFactory *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static HRESULT WINAPI HTMLXMLHttpRequestFactory_Invoke(IHTMLXMLHttpRequestFactory *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static ULONG WINAPI HTMLXMLHttpRequestFactory_AddRef(IHTMLXMLHttpRequestFactory *iface)

Definition at line 768 of file xmlhttprequest.c.

Referenced by HTMLXMLHttpRequestFactory_Create().

◆ HTMLXMLHttpRequestVtbl

const IHTMLXMLHttpRequestVtbl HTMLXMLHttpRequestVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HTMLXMLHttpRequest_getAllResponseHeaders(IHTMLXMLHttpRequest *iface, BSTR *p)
static HRESULT WINAPI HTMLXMLHttpRequest_put_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT v)
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfoCount(IHTMLXMLHttpRequest *iface, UINT *pctinfo)
static HRESULT WINAPI HTMLXMLHttpRequest_GetIDsOfNames(IHTMLXMLHttpRequest *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static HRESULT WINAPI HTMLXMLHttpRequest_getResponseHeader(IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR *p)
static HRESULT WINAPI HTMLXMLHttpRequest_GetTypeInfo(IHTMLXMLHttpRequest *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static HRESULT WINAPI HTMLXMLHttpRequest_open(IHTMLXMLHttpRequest *iface, BSTR bstrMethod, BSTR bstrUrl, VARIANT varAsync, VARIANT varUser, VARIANT varPassword)
static HRESULT WINAPI HTMLXMLHttpRequest_get_status(IHTMLXMLHttpRequest *iface, LONG *p)
static HRESULT WINAPI HTMLXMLHttpRequest_get_onreadystatechange(IHTMLXMLHttpRequest *iface, VARIANT *p)
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseBody(IHTMLXMLHttpRequest *iface, VARIANT *p)
static HRESULT WINAPI HTMLXMLHttpRequest_QueryInterface(IHTMLXMLHttpRequest *iface, REFIID riid, void **ppv)
static ULONG WINAPI HTMLXMLHttpRequest_AddRef(IHTMLXMLHttpRequest *iface)
static HRESULT WINAPI HTMLXMLHttpRequest_abort(IHTMLXMLHttpRequest *iface)
static HRESULT WINAPI HTMLXMLHttpRequest_Invoke(IHTMLXMLHttpRequest *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseText(IHTMLXMLHttpRequest *iface, BSTR *p)
static HRESULT WINAPI HTMLXMLHttpRequest_get_readyState(IHTMLXMLHttpRequest *iface, LONG *p)
static HRESULT WINAPI HTMLXMLHttpRequest_get_statusText(IHTMLXMLHttpRequest *iface, BSTR *p)
static HRESULT WINAPI HTMLXMLHttpRequest_send(IHTMLXMLHttpRequest *iface, VARIANT varBody)
static HRESULT WINAPI HTMLXMLHttpRequest_setRequestHeader(IHTMLXMLHttpRequest *iface, BSTR bstrHeader, BSTR bstrValue)
static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *iface, IDispatch **p)
static ULONG WINAPI HTMLXMLHttpRequest_Release(IHTMLXMLHttpRequest *iface)

Definition at line 568 of file xmlhttprequest.c.

Referenced by HTMLXMLHttpRequestFactory_create().

◆ XMLHttpReqEventListenerVtbl

const nsIDOMEventListenerVtbl XMLHttpReqEventListenerVtbl
static
Initial value:
= {
}
static nsrefcnt NSAPI XMLHttpReqEventListener_AddRef(nsIDOMEventListener *iface)
static nsresult NSAPI XMLHttpReqEventListener_QueryInterface(nsIDOMEventListener *iface, nsIIDRef riid, void **result)
static nsrefcnt NSAPI XMLHttpReqEventListener_Release(nsIDOMEventListener *iface)
static nsresult NSAPI XMLHttpReqEventListener_HandleEvent(nsIDOMEventListener *iface, nsIDOMEvent *event)

Definition at line 181 of file xmlhttprequest.c.

Referenced by HTMLXMLHttpRequest_bind_event().