2024-03-22 23:27:34 -07:00
|
|
|
From c4694f8dfffa56648976c1a05bb4788262a8677b Mon Sep 17 00:00:00 2001
|
2020-09-08 19:37:05 -07:00
|
|
|
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
|
|
|
Date: Tue, 8 Sep 2020 18:43:52 +0200
|
2020-10-29 08:47:54 -07:00
|
|
|
Subject: [PATCH] msxml3: Implement FreeThreadedXMLHTTP60.
|
2020-09-08 19:37:05 -07:00
|
|
|
|
2021-05-18 18:33:46 -07:00
|
|
|
Update from Gijs Vermeulen <gijsvrm@gmail.com>
|
2020-09-08 19:37:05 -07:00
|
|
|
---
|
|
|
|
dlls/msxml3/Makefile.in | 2 +-
|
2020-10-29 08:47:54 -07:00
|
|
|
dlls/msxml3/factory.c | 5 +
|
2022-09-03 12:53:05 -07:00
|
|
|
dlls/msxml3/httprequest.c | 495 +++++++++++++++++++++++++++++++++++-
|
2020-09-08 19:37:05 -07:00
|
|
|
dlls/msxml3/msxml_private.h | 1 +
|
2021-05-18 18:33:46 -07:00
|
|
|
dlls/msxml3/tests/httpreq.c | 395 +++++++++++++++++++++++++++-
|
|
|
|
dlls/msxml3/tests/schema.c | 6 +
|
|
|
|
dlls/msxml3/uuid.c | 5 +
|
2023-10-05 12:53:15 -07:00
|
|
|
include/msxml6.idl | 22 +-
|
|
|
|
8 files changed, 915 insertions(+), 16 deletions(-)
|
2020-09-08 19:37:05 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in
|
2023-10-16 16:12:05 -07:00
|
|
|
index 7e59a223143..5044c4e2c79 100644
|
2020-09-08 19:37:05 -07:00
|
|
|
--- a/dlls/msxml3/Makefile.in
|
|
|
|
+++ b/dlls/msxml3/Makefile.in
|
2022-02-03 17:28:48 -08:00
|
|
|
@@ -1,5 +1,5 @@
|
2020-09-08 19:37:05 -07:00
|
|
|
MODULE = msxml3.dll
|
2021-10-20 15:41:51 -07:00
|
|
|
-IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32
|
|
|
|
+IMPORTS = $(XSLT_PE_LIBS) $(XML2_PE_LIBS) uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 rtworkq
|
|
|
|
EXTRAINCL = $(XSLT_PE_CFLAGS) $(XML2_PE_CFLAGS)
|
2020-09-08 19:37:05 -07:00
|
|
|
|
2023-10-16 16:12:05 -07:00
|
|
|
SOURCES = \
|
2020-10-29 08:47:54 -07:00
|
|
|
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
|
2024-03-22 23:27:34 -07:00
|
|
|
index 218ba87c4a8..ed14bd63a87 100644
|
2020-10-29 08:47:54 -07:00
|
|
|
--- a/dlls/msxml3/factory.c
|
|
|
|
+++ b/dlls/msxml3/factory.c
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -281,6 +281,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
|
2020-10-29 08:47:54 -07:00
|
|
|
|
|
|
|
static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create };
|
|
|
|
static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create };
|
|
|
|
+static ClassFactory httpreqcf2 = { { &ClassFactoryVtbl }, XMLHTTPRequest2_create };
|
|
|
|
static ClassFactory serverhttp = { { &ClassFactoryVtbl }, ServerXMLHTTP_create };
|
|
|
|
static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create };
|
|
|
|
static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create };
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -342,6 +343,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
|
2020-10-29 08:47:54 -07:00
|
|
|
{
|
|
|
|
cf = &httpreqcf.IClassFactory_iface;
|
|
|
|
}
|
|
|
|
+ else if( IsEqualCLSID( rclsid, &CLSID_FreeThreadedXMLHTTP60 ))
|
|
|
|
+ {
|
|
|
|
+ cf = &httpreqcf2.IClassFactory_iface;
|
|
|
|
+ }
|
|
|
|
else if( IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP ) ||
|
|
|
|
IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP30 ) ||
|
|
|
|
IsEqualCLSID( rclsid, &CLSID_ServerXMLHTTP40 ) ||
|
2020-09-08 19:37:05 -07:00
|
|
|
diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
|
2024-03-22 23:27:34 -07:00
|
|
|
index 6e4ab4c6519..412958a2a40 100644
|
2020-09-08 19:37:05 -07:00
|
|
|
--- a/dlls/msxml3/httprequest.c
|
|
|
|
+++ b/dlls/msxml3/httprequest.c
|
2023-07-31 16:59:38 -07:00
|
|
|
@@ -37,10 +37,12 @@
|
2020-09-08 19:37:05 -07:00
|
|
|
#include "shlwapi.h"
|
|
|
|
|
2021-08-17 15:34:28 -07:00
|
|
|
#include "msxml_dispex.h"
|
2020-09-08 19:37:05 -07:00
|
|
|
+#include "initguid.h"
|
|
|
|
+#include "rtworkq.h"
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
-WINE_DEFAULT_DEBUG_CHANNEL(msxml);
|
|
|
|
+WINE_DEFAULT_DEBUG_CHANNEL(xmlhttp);
|
|
|
|
|
|
|
|
static const WCHAR colspaceW[] = {':',' ',0};
|
|
|
|
static const WCHAR crlfW[] = {'\r','\n',0};
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -2054,6 +2056,468 @@ static const struct IServerXMLHTTPRequestVtbl ServerXMLHTTPRequestVtbl =
|
2020-09-08 19:37:05 -07:00
|
|
|
ServerXMLHTTPRequest_setOption
|
|
|
|
};
|
|
|
|
|
|
|
|
+static DWORD xhr2_work_queue;
|
|
|
|
+
|
|
|
|
+struct xml_http_request_2
|
|
|
|
+{
|
|
|
|
+ httprequest req;
|
2021-05-18 18:33:46 -07:00
|
|
|
+ IXMLHTTPRequest3 IXMLHTTPRequest3_iface;
|
2020-09-08 19:37:05 -07:00
|
|
|
+ IRtwqAsyncCallback IRtwqAsyncCallback_iface;
|
|
|
|
+ IDispatch IDispatch_iface;
|
|
|
|
+
|
|
|
|
+ IXMLHTTPRequest2Callback *callback;
|
|
|
|
+ IXMLHTTPRequest3Callback *callback3;
|
|
|
|
+ ISequentialStream *response_body;
|
|
|
|
+ ISequentialStream *request_body;
|
|
|
|
+ ULONGLONG request_body_size;
|
|
|
|
+};
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static inline struct xml_http_request_2 *impl_from_IXMLHTTPRequest3(IXMLHTTPRequest3 *iface)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return CONTAINING_RECORD(iface, struct xml_http_request_2, IXMLHTTPRequest3_iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline struct xml_http_request_2 *xml_http_request_2_from_IRtwqAsyncCallback(IRtwqAsyncCallback *iface)
|
|
|
|
+{
|
|
|
|
+ return CONTAINING_RECORD(iface, struct xml_http_request_2, IRtwqAsyncCallback_iface);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline struct xml_http_request_2 *xml_http_request_2_from_IDispatch(IDispatch *iface)
|
|
|
|
+{
|
|
|
|
+ return CONTAINING_RECORD(iface, struct xml_http_request_2, IDispatch_iface);
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_QueryInterface(IXMLHTTPRequest3 *iface, REFIID riid, void **obj)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+ if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2)
|
|
|
|
+ || IsEqualGUID(riid, &IID_IUnknown))
|
2020-09-08 19:37:05 -07:00
|
|
|
+ {
|
|
|
|
+ *obj = iface;
|
2021-05-18 18:33:46 -07:00
|
|
|
+ IUnknown_AddRef((IUnknown*)*obj);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FIXME("Unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
+ *obj = NULL;
|
|
|
|
+ return E_NOINTERFACE;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static ULONG WINAPI xml_http_request_2_AddRef(IXMLHTTPRequest3 *iface)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ ULONG ref = InterlockedIncrement(&This->req.ref);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ TRACE("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static ULONG WINAPI xml_http_request_2_Release(IXMLHTTPRequest3 *iface)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ ULONG ref = InterlockedDecrement(&This->req.ref);
|
|
|
|
+
|
2022-03-15 18:03:11 -07:00
|
|
|
+ TRACE("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ if (ref == 0)
|
|
|
|
+ {
|
|
|
|
+ /* do not call httprequest_put_onreadystatechange to avoid ref cycle */
|
|
|
|
+ This->req.sink = NULL;
|
|
|
|
+ if (This->response_body) ISequentialStream_Release(This->response_body);
|
|
|
|
+ if (This->request_body) ISequentialStream_Release(This->request_body);
|
|
|
|
+ if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3);
|
|
|
|
+ if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback);
|
2024-02-22 15:04:43 -08:00
|
|
|
+ free(This);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ RtwqShutdown();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_Open(IXMLHTTPRequest3 *iface, const WCHAR *method,
|
2020-09-08 19:37:05 -07:00
|
|
|
+ const WCHAR *url, IXMLHTTPRequest2Callback *callback,
|
|
|
|
+ const WCHAR *username, const WCHAR *password,
|
|
|
|
+ const WCHAR *proxy_username, const WCHAR *proxy_password)
|
|
|
|
+{
|
|
|
|
+ static const WCHAR accept_encoding[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',0};
|
|
|
|
+ static const WCHAR empty = 0;
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ VARIANT async_v, username_v, password_v;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%s %s %p %s %s %s %s)\n", This, debugstr_w(method), debugstr_w(url), callback,
|
|
|
|
+ debugstr_w(username), debugstr_w(password), debugstr_w(proxy_username), debugstr_w(proxy_password));
|
|
|
|
+
|
|
|
|
+ if (This->callback) IXMLHTTPRequest2Callback_Release(This->callback);
|
|
|
|
+ if (This->callback3) IXMLHTTPRequest3Callback_Release(This->callback3);
|
|
|
|
+ IXMLHTTPRequest2Callback_AddRef(callback);
|
|
|
|
+ This->callback = callback;
|
|
|
|
+ if (FAILED(IXMLHTTPRequest2Callback_QueryInterface(callback, &IID_IXMLHTTPRequest3Callback, (void **)&This->callback3)))
|
|
|
|
+ This->callback3 = NULL;
|
|
|
|
+
|
|
|
|
+ if (proxy_username || proxy_password) FIXME("proxy credentials not implemented\n");
|
|
|
|
+
|
|
|
|
+ VariantInit(&async_v);
|
|
|
|
+ V_VT(&async_v) = VT_BOOL;
|
|
|
|
+ V_BOOL(&async_v) = FALSE; /* FIXME: TRUE needs a RTWQ_WINDOW_WORKQUEUE */
|
|
|
|
+
|
|
|
|
+ VariantInit(&username_v);
|
|
|
|
+ V_VT(&username_v) = VT_BSTR;
|
|
|
|
+ if (username) V_BSTR(&username_v) = SysAllocString(username);
|
|
|
|
+ else V_BSTR(&username_v) = SysAllocString(&empty);
|
|
|
|
+
|
|
|
|
+ VariantInit(&password_v);
|
|
|
|
+ V_VT(&password_v) = VT_BSTR;
|
|
|
|
+ if (password) V_BSTR(&password_v) = SysAllocString(password);
|
|
|
|
+ else V_BSTR(&password_v) = SysAllocString(&empty);
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = httprequest_open(&This->req, (BSTR)method, (BSTR)url, async_v, username_v, password_v)))
|
|
|
|
+ return hr;
|
|
|
|
+ return httprequest_setRequestHeader(&This->req, (BSTR)accept_encoding, (BSTR)&empty);
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_Send(IXMLHTTPRequest3 *iface, ISequentialStream *body, ULONGLONG body_size)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ IRtwqAsyncResult *result;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%p %s)\n", This, body, wine_dbgstr_longlong( body_size ));
|
|
|
|
+
|
|
|
|
+ if (body_size)
|
|
|
|
+ {
|
|
|
|
+ ISequentialStream_AddRef(body);
|
|
|
|
+ This->request_body = body;
|
|
|
|
+ This->request_body_size = body_size;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = RtwqCreateAsyncResult(NULL, &This->IRtwqAsyncCallback_iface, NULL, &result)))
|
|
|
|
+ return hr;
|
|
|
|
+ // IRtwqAsyncCallback_Invoke(&This->IRtwqAsyncCallback_iface, result);
|
|
|
|
+ hr = RtwqPutWorkItem(xhr2_work_queue, 0, result);
|
|
|
|
+ if (result) IRtwqAsyncResult_Release(result);
|
|
|
|
+
|
|
|
|
+ return hr;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_Abort(IXMLHTTPRequest3 *iface)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ TRACE("(%p) stub!\n", This);
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_SetCookie(IXMLHTTPRequest3 *iface, const XHR_COOKIE *cookie, DWORD *state)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ FIXME("(%p)->(%p %p) stub!\n", This, cookie, state);
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_SetCustomResponseStream(IXMLHTTPRequest3 *iface, ISequentialStream *stream)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ FIXME("(%p)->(%p) stub!\n", This, stream);
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_SetProperty(IXMLHTTPRequest3 *iface, XHR_PROPERTY property, ULONGLONG value)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ FIXME("(%p)->(%#x %s) stub!\n", This, property, wine_dbgstr_longlong( value ));
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_SetRequestHeader(IXMLHTTPRequest3 *iface,
|
2020-09-08 19:37:05 -07:00
|
|
|
+ const WCHAR *header, const WCHAR *value)
|
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ TRACE("(%p)->(%s %s)\n", This, debugstr_w(header), debugstr_w(value));
|
|
|
|
+ return httprequest_setRequestHeader(&This->req, (BSTR)header, (BSTR)value);
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_GetAllResponseHeaders(IXMLHTTPRequest3 *iface, WCHAR **headers)
|
2020-09-08 19:37:05 -07:00
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ FIXME("(%p)->(%p) stub!\n", This, headers);
|
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_GetCookie(IXMLHTTPRequest3 *iface, const WCHAR *url,
|
2020-09-08 19:37:05 -07:00
|
|
|
+ const WCHAR *name, DWORD flags,
|
|
|
|
+ ULONG *cookies_count, XHR_COOKIE **cookies)
|
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ FIXME("(%p)->(%s %s %ld %p %p) stub!\n", This, debugstr_w(url), debugstr_w(name), flags, cookies_count, cookies);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_2_GetResponseHeader(IXMLHTTPRequest3 *iface,
|
2020-09-08 19:37:05 -07:00
|
|
|
+ const WCHAR *header, WCHAR **value)
|
|
|
|
+{
|
2021-05-18 18:33:46 -07:00
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(header), value);
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = httprequest_getResponseHeader(&This->req, (BSTR)header, value)))
|
|
|
|
+ return hr;
|
|
|
|
+
|
|
|
|
+#define E_FILE_NOT_FOUND _HRESULT_TYPEDEF_(0x80070002)
|
|
|
|
+
|
|
|
|
+ if (hr == S_FALSE)
|
|
|
|
+ {
|
|
|
|
+ *value = NULL;
|
|
|
|
+ return E_FILE_NOT_FOUND;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return hr;
|
|
|
|
+}
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+static HRESULT WINAPI xml_http_request_3_SetClientCertificate(IXMLHTTPRequest3 *iface, DWORD count, const BYTE *hashes, const WCHAR *pin)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = impl_from_IXMLHTTPRequest3(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ FIXME("(%p)->(%ld %p %s) stub!\n", This, count, hashes, debugstr_w(pin));
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return E_NOTIMPL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const struct IXMLHTTPRequest3Vtbl XMLHTTPRequest3Vtbl = {
|
2020-09-08 19:37:05 -07:00
|
|
|
+ /* IUnknown methods */
|
|
|
|
+ xml_http_request_2_QueryInterface,
|
|
|
|
+ xml_http_request_2_AddRef,
|
|
|
|
+ xml_http_request_2_Release,
|
|
|
|
+ /* IXMLHTTPRequest2 methods */
|
|
|
|
+ xml_http_request_2_Open,
|
|
|
|
+ xml_http_request_2_Send,
|
|
|
|
+ xml_http_request_2_Abort,
|
|
|
|
+ xml_http_request_2_SetCookie,
|
|
|
|
+ xml_http_request_2_SetCustomResponseStream,
|
|
|
|
+ xml_http_request_2_SetProperty,
|
|
|
|
+ xml_http_request_2_SetRequestHeader,
|
|
|
|
+ xml_http_request_2_GetAllResponseHeaders,
|
|
|
|
+ xml_http_request_2_GetCookie,
|
|
|
|
+ xml_http_request_2_GetResponseHeader,
|
2021-05-18 18:33:46 -07:00
|
|
|
+ /* IXMLHTTPRequest3 methods */
|
|
|
|
+ xml_http_request_3_SetClientCertificate,
|
2020-09-08 19:37:05 -07:00
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_QueryInterface(IRtwqAsyncCallback *iface, REFIID riid, void **obj)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface);
|
|
|
|
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
+
|
|
|
|
+ if (IsEqualGUID(riid, &IID_IRtwqAsyncCallback) || IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
+ {
|
|
|
|
+ IRtwqAsyncCallback_AddRef(iface);
|
|
|
|
+ *obj = iface;
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FIXME("Unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
+ *obj = NULL;
|
|
|
|
+ return E_NOINTERFACE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_AddRef(IRtwqAsyncCallback *iface)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface);
|
|
|
|
+ TRACE("(%p)\n", This);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xml_http_request_2_IRtwqAsyncCallback_Release(IRtwqAsyncCallback *iface)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface);
|
|
|
|
+ TRACE("(%p)\n", This);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_GetParameters(IRtwqAsyncCallback *iface,
|
|
|
|
+ DWORD *flags, DWORD *queue)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface);
|
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%p %p)\n", This, flags, queue);
|
|
|
|
+
|
|
|
|
+ *flags = 0;
|
|
|
|
+ *queue = xhr2_work_queue;
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IRtwqAsyncCallback_Invoke(IRtwqAsyncCallback *iface,
|
|
|
|
+ IRtwqAsyncResult *result)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IRtwqAsyncCallback(iface);
|
|
|
|
+ VARIANT body_v;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+ ULONG read;
|
|
|
|
+
|
|
|
|
+ TRACE("(%p)->(%p)\n", This, result);
|
|
|
|
+
|
|
|
|
+ VariantInit(&body_v);
|
|
|
|
+
|
|
|
|
+ if (This->request_body)
|
|
|
|
+ {
|
|
|
|
+ V_VT(&body_v) = VT_BSTR;
|
|
|
|
+ V_BSTR(&body_v) = CoTaskMemAlloc(This->request_body_size);
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = ISequentialStream_Read(This->request_body, V_BSTR(&body_v), This->request_body_size, &read)) ||
|
|
|
|
+ read < This->request_body_size)
|
|
|
|
+ {
|
2022-03-15 18:03:11 -07:00
|
|
|
+ ERR("Failed to allocate request body memory, hr %#lx\n", hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ CoTaskMemFree(V_BSTR(&body_v));
|
|
|
|
+ goto done;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ISequentialStream_Release(This->request_body);
|
|
|
|
+ This->request_body = NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hr = httprequest_send(&This->req, body_v);
|
|
|
|
+
|
|
|
|
+done:
|
|
|
|
+ return IRtwqAsyncResult_SetStatus(result, hr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const struct IRtwqAsyncCallbackVtbl xml_http_request_2_IRtwqAsyncCallbackVtbl = {
|
|
|
|
+ /* IUnknown methods */
|
|
|
|
+ xml_http_request_2_IRtwqAsyncCallback_QueryInterface,
|
|
|
|
+ xml_http_request_2_IRtwqAsyncCallback_AddRef,
|
|
|
|
+ xml_http_request_2_IRtwqAsyncCallback_Release,
|
|
|
|
+ /* IRtwqAsyncCallback methods */
|
|
|
|
+ xml_http_request_2_IRtwqAsyncCallback_GetParameters,
|
|
|
|
+ xml_http_request_2_IRtwqAsyncCallback_Invoke,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **obj)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
|
|
|
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
+
|
|
|
|
+ if (IsEqualGUID(riid, &IID_IDispatch) || IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
+ {
|
|
|
|
+ IDispatch_AddRef(iface);
|
|
|
|
+ *obj = iface;
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FIXME("Unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
+ *obj = NULL;
|
|
|
|
+ return E_NOINTERFACE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xml_http_request_2_IDispatch_AddRef(IDispatch *iface)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
|
|
|
+ TRACE("(%p)\n", This);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return xml_http_request_2_AddRef(&This->IXMLHTTPRequest3_iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xml_http_request_2_IDispatch_Release(IDispatch *iface)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
|
|
|
+ TRACE("(%p)\n", This);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ return xml_http_request_2_Release(&This->IXMLHTTPRequest3_iface);
|
2020-09-08 19:37:05 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfoCount(IDispatch *iface, UINT *value)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
|
|
|
+ FIXME("(%p)->(%p) stub!\n", This, value);
|
|
|
|
+ *value = 0;
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IDispatch_GetTypeInfo(IDispatch *iface, UINT index,
|
|
|
|
+ LCID lcid, ITypeInfo **value)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ FIXME("(%p)->(%d %lu %p) stub!\n", This, index, lcid, value);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ *value = NULL;
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid,
|
|
|
|
+ OLECHAR **names, UINT names_count,
|
|
|
|
+ LCID lcid, DISPID *disp_ids)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ FIXME("(%p)->(%s %p %d %lu %p) stub!\n", This, debugstr_guid(riid), names, names_count, lcid, disp_ids);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xml_http_request_2_IDispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid,
|
|
|
|
+ LCID lcid, WORD flags, DISPPARAMS *params,
|
|
|
|
+ VARIANT *result, EXCEPINFO *exception, UINT *arg_err)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *This = xml_http_request_2_from_IDispatch(iface);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ IXMLHTTPRequest2 *xhr2_iface = (IXMLHTTPRequest2*)&This->IXMLHTTPRequest3_iface;
|
2020-09-08 19:37:05 -07:00
|
|
|
+ HRESULT hr;
|
|
|
|
+ LONG status;
|
|
|
|
+ BSTR status_str = NULL;
|
|
|
|
+
|
2022-03-15 18:03:11 -07:00
|
|
|
+ TRACE("(%p)->(%ld %s %lu %d %p %p %p %p) stub!\n", This, id, debugstr_guid(riid), lcid, flags,
|
2020-09-08 19:37:05 -07:00
|
|
|
+ params, result, exception, arg_err);
|
|
|
|
+
|
|
|
|
+ if (This->req.state == READYSTATE_COMPLETE)
|
|
|
|
+ {
|
|
|
|
+ VARIANT body_v;
|
|
|
|
+ VariantInit(&body_v);
|
|
|
|
+
|
|
|
|
+ IXMLHTTPRequest2Callback_AddRef(This->callback);
|
|
|
|
+ if (This->callback3)
|
|
|
|
+ {
|
|
|
|
+ IXMLHTTPRequest3Callback_AddRef(This->callback3);
|
|
|
|
+ IXMLHTTPRequest3Callback_OnServerCertificateReceived(This->callback3, (IXMLHTTPRequest3 *)xhr2_iface, 0, 1, NULL);
|
|
|
|
+ IXMLHTTPRequest3Callback_Release(This->callback3);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = httprequest_get_status(&This->req, &status)) ||
|
|
|
|
+ FAILED(hr = httprequest_get_statusText(&This->req, &status_str)))
|
|
|
|
+ {
|
2022-03-15 18:03:11 -07:00
|
|
|
+ WARN("failed to get response status, error %#lx\n", hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr);
|
|
|
|
+ IXMLHTTPRequest2Callback_Release(This->callback);
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ IXMLHTTPRequest2Callback_OnHeadersAvailable(This->callback, xhr2_iface, status, status_str);
|
|
|
|
+ SysFreeString(status_str);
|
|
|
|
+
|
|
|
|
+ if (This->response_body) ISequentialStream_Release(This->response_body);
|
|
|
|
+ This->response_body = NULL;
|
|
|
|
+
|
|
|
|
+ if (FAILED(hr = httprequest_get_responseStream(&This->req, &body_v)) ||
|
|
|
|
+ FAILED(hr = IUnknown_QueryInterface(V_UNKNOWN(&body_v), &IID_ISequentialStream, (void **)&This->response_body)))
|
|
|
|
+ {
|
2022-03-15 18:03:11 -07:00
|
|
|
+ WARN("failed to get response stream, error %#lx\n", hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ IXMLHTTPRequest2Callback_OnError(This->callback, xhr2_iface, hr);
|
|
|
|
+ IXMLHTTPRequest2Callback_Release(This->callback);
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ IXMLHTTPRequest2Callback_OnDataAvailable(This->callback, xhr2_iface, This->response_body);
|
|
|
|
+ IXMLHTTPRequest2Callback_OnResponseReceived(This->callback, xhr2_iface, This->response_body);
|
|
|
|
+ IXMLHTTPRequest2Callback_Release(This->callback);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const struct IDispatchVtbl xml_http_request_2_IDispatchVtbl = {
|
|
|
|
+ /* IUnknown methods */
|
|
|
|
+ xml_http_request_2_IDispatch_QueryInterface,
|
|
|
|
+ xml_http_request_2_IDispatch_AddRef,
|
|
|
|
+ xml_http_request_2_IDispatch_Release,
|
|
|
|
+ /* IDispatch methods */
|
|
|
|
+ xml_http_request_2_IDispatch_GetTypeInfoCount,
|
|
|
|
+ xml_http_request_2_IDispatch_GetTypeInfo,
|
|
|
|
+ xml_http_request_2_IDispatch_GetIDsOfNames,
|
|
|
|
+ xml_http_request_2_IDispatch_Invoke,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
static void init_httprequest(httprequest *req)
|
|
|
|
{
|
|
|
|
req->IXMLHTTPRequest_iface.lpVtbl = &XMLHTTPRequestVtbl;
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -2103,6 +2567,35 @@ HRESULT XMLHTTPRequest_create(void **obj)
|
2020-09-08 19:37:05 -07:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
+HRESULT XMLHTTPRequest2_create(void **obj)
|
|
|
|
+{
|
|
|
|
+ struct xml_http_request_2 *xhr2;
|
|
|
|
+ TRACE("(%p)\n", obj);
|
|
|
|
+
|
2024-02-22 15:04:43 -08:00
|
|
|
+ if (!(xhr2 = malloc(sizeof(*xhr2)))) return E_OUTOFMEMORY;
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ init_httprequest(&xhr2->req);
|
2021-05-18 18:33:46 -07:00
|
|
|
+ xhr2->IXMLHTTPRequest3_iface.lpVtbl = &XMLHTTPRequest3Vtbl;
|
2020-09-08 19:37:05 -07:00
|
|
|
+ xhr2->IRtwqAsyncCallback_iface.lpVtbl = &xml_http_request_2_IRtwqAsyncCallbackVtbl;
|
|
|
|
+ xhr2->IDispatch_iface.lpVtbl = &xml_http_request_2_IDispatchVtbl;
|
|
|
|
+
|
|
|
|
+ /* do not call httprequest_put_onreadystatechange to avoid ref cycle */
|
|
|
|
+ xhr2->req.sink = &xhr2->IDispatch_iface;
|
|
|
|
+
|
|
|
|
+ xhr2->callback = NULL;
|
|
|
|
+ xhr2->callback3 = NULL;
|
|
|
|
+ xhr2->request_body = NULL;
|
|
|
|
+ xhr2->response_body = NULL;
|
|
|
|
+
|
|
|
|
+ /* for async http requests we need window message queue */
|
|
|
|
+ RtwqStartup();
|
|
|
|
+ if (!xhr2_work_queue) RtwqAllocateWorkQueue(RTWQ_MULTITHREADED_WORKQUEUE, &xhr2_work_queue);
|
|
|
|
+
|
2021-05-18 18:33:46 -07:00
|
|
|
+ *obj = &xhr2->IXMLHTTPRequest3_iface;
|
2020-09-08 19:37:05 -07:00
|
|
|
+ TRACE("returning iface %p\n", *obj);
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
HRESULT ServerXMLHTTP_create(void **obj)
|
|
|
|
{
|
|
|
|
serverhttp *req;
|
|
|
|
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
|
2024-03-22 23:27:34 -07:00
|
|
|
index 54f54995c76..6188414c5ce 100644
|
2020-09-08 19:37:05 -07:00
|
|
|
--- a/dlls/msxml3/msxml_private.h
|
|
|
|
+++ b/dlls/msxml3/msxml_private.h
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -343,6 +343,7 @@ extern HRESULT XMLDocument_create(void**);
|
2023-07-31 16:59:38 -07:00
|
|
|
extern HRESULT SAXXMLReader_create(MSXML_VERSION, void**);
|
|
|
|
extern HRESULT SAXAttributes_create(MSXML_VERSION, void**);
|
|
|
|
extern HRESULT XMLHTTPRequest_create(void **);
|
|
|
|
+extern HRESULT XMLHTTPRequest2_create(void **);
|
|
|
|
extern HRESULT ServerXMLHTTP_create(void **);
|
|
|
|
extern HRESULT XSLTemplate_create(void**);
|
|
|
|
extern HRESULT MXWriter_create(MSXML_VERSION, void**);
|
2020-09-08 19:37:05 -07:00
|
|
|
diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c
|
2022-09-03 12:53:05 -07:00
|
|
|
index bccfbaf582a..23d7680d196 100644
|
2020-09-08 19:37:05 -07:00
|
|
|
--- a/dlls/msxml3/tests/httpreq.c
|
|
|
|
+++ b/dlls/msxml3/tests/httpreq.c
|
2020-09-14 18:15:32 -07:00
|
|
|
@@ -26,9 +26,9 @@
|
|
|
|
#include <assert.h>
|
2020-09-08 19:37:05 -07:00
|
|
|
|
|
|
|
#include "windows.h"
|
2020-09-14 18:15:32 -07:00
|
|
|
-
|
|
|
|
#include "msxml2.h"
|
2020-09-08 19:37:05 -07:00
|
|
|
-#include "msxml2did.h"
|
|
|
|
+#include "msxml6.h"
|
|
|
|
+#include "msxml6did.h"
|
|
|
|
#include "dispex.h"
|
|
|
|
|
|
|
|
#include "initguid.h"
|
2022-09-03 12:53:05 -07:00
|
|
|
@@ -1344,6 +1344,17 @@ static IXMLHttpRequest *create_xhr(void)
|
2020-09-08 19:37:05 -07:00
|
|
|
return SUCCEEDED(hr) ? ret : NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
+static IXMLHTTPRequest2 *create_xhr2(void)
|
|
|
|
+{
|
|
|
|
+ IXMLHTTPRequest2 *ret;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
|
|
|
+ hr = CoCreateInstance(&CLSID_FreeThreadedXMLHTTP60, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
+ &IID_IXMLHTTPRequest2, (void**)&ret);
|
|
|
|
+
|
|
|
|
+ return SUCCEEDED(hr) ? ret : NULL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static IServerXMLHTTPRequest *create_server_xhr(void)
|
|
|
|
{
|
|
|
|
IServerXMLHTTPRequest *ret;
|
2022-09-03 12:53:05 -07:00
|
|
|
@@ -1904,11 +1915,388 @@ static void test_supporterrorinfo(void)
|
2020-09-08 19:37:05 -07:00
|
|
|
IServerXMLHTTPRequest_Release(server_xhr);
|
|
|
|
}
|
|
|
|
|
|
|
|
+struct xhr3_callback
|
|
|
|
+{
|
|
|
|
+ IXMLHTTPRequest3Callback IXMLHTTPRequest3Callback_iface;
|
|
|
|
+ LONG ref;
|
|
|
|
+ HANDLE event;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static inline struct xhr3_callback *xhr3_callback_from_IXMLHTTPRequest3Callback(IXMLHTTPRequest3Callback *iface)
|
|
|
|
+{
|
|
|
|
+ return CONTAINING_RECORD(iface, struct xhr3_callback, IXMLHTTPRequest3Callback_iface);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_QueryInterface(IXMLHTTPRequest3Callback *iface, REFIID riid, void **obj)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
+
|
|
|
|
+ if (IsEqualGUID(riid, &IID_IXMLHTTPRequest3Callback) || IsEqualGUID(riid, &IID_IXMLHTTPRequest2Callback) || IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
+ {
|
|
|
|
+ IXMLHTTPRequest3Callback_AddRef(iface);
|
|
|
|
+ *obj = iface;
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ok(0, "unexpected interface %s\n", debugstr_guid(riid));
|
|
|
|
+ return E_NOINTERFACE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xhr3_callback_AddRef(IXMLHTTPRequest3Callback *iface)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ ULONG ref = InterlockedIncrement(&This->ref);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xhr3_callback_Release(IXMLHTTPRequest3Callback *iface)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ ULONG ref = InterlockedDecrement(&This->ref);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnRedirect(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest2 *request, const WCHAR* redirect_url)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ trace("(%p)->(%p %s)\n", This, request, debugstr_w(redirect_url));
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnHeadersAvailable(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest2 *request, DWORD status, const WCHAR *status_str)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ WCHAR *header = NULL;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %lu %s)\n", This, request, status, debugstr_w(status_str));
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ header = (void *)0xdeadbeef;
|
|
|
|
+ hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Length", &header);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Content-Length: %p (%s), hr %#lx\n", header, debugstr_w(header), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnDataAvailable(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest2 *request, ISequentialStream *response)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ trace("(%p)->(%p %p)\n", This, request, response);
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnResponseReceived(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest2 *request, ISequentialStream *response)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
|
|
|
+ WCHAR *header = NULL;
|
|
|
|
+ char *buffer = HeapAlloc( GetProcessHeap(), 0, 256 );
|
|
|
|
+ ULONG read_size = 0;
|
|
|
|
+ HRESULT hr;
|
|
|
|
+
|
|
|
|
+ memset(buffer, '?', 256);
|
|
|
|
+ buffer[255] = 0;
|
|
|
|
+
|
|
|
|
+ trace("(%p)->(%p %p)\n", This, request, response);
|
|
|
|
+
|
|
|
|
+ header = (void *)0xdeadbeef;
|
|
|
|
+ hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Cache-Control", &header);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Cache-Control: %p (%s), hr %#lx\n", header, debugstr_w(header), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ header = (void *)0xdeadbeef;
|
|
|
|
+ hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Expires", &header);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Expires: %p (%s), hr %#lx\n", header, debugstr_w(header), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ header = (void *)0xdeadbeef;
|
|
|
|
+ hr = IXMLHTTPRequest2_GetResponseHeader(request, L"Content-Type", &header);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Content-Type: %p (%s), hr %#lx\n", header, debugstr_w(header), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ read_size = 0xdeadbeef;
|
|
|
|
+ hr = ISequentialStream_Read(response, buffer, 214, &read_size);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ read_size = 0xdeadbeef;
|
|
|
|
+ hr = ISequentialStream_Read(response, buffer, 1, &read_size);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("Response: (%ld) %s, hr %#lx\n", read_size, debugstr_a(buffer), hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
+ SetEvent(This->event);
|
|
|
|
+
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnError(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest2 *request, HRESULT error)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %#lx)\n", This, request, error);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ SetEvent(This->event);
|
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnServerCertificateReceived(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest3 *request, DWORD errors, DWORD chain_size, const XHR_CERT *chain)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %lu %lu %p)\n", This, request, errors, chain_size, chain);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr3_callback_OnClientCertificateRequested(IXMLHTTPRequest3Callback *iface,
|
|
|
|
+ IXMLHTTPRequest3 *request, DWORD issuers_size, const WCHAR **issuers)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = xhr3_callback_from_IXMLHTTPRequest3Callback(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %lu %p)\n", This, request, issuers_size, issuers);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return S_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const IXMLHTTPRequest3CallbackVtbl xhr3_callback_vtbl =
|
|
|
|
+{
|
|
|
|
+ xhr3_callback_QueryInterface,
|
|
|
|
+ xhr3_callback_AddRef,
|
|
|
|
+ xhr3_callback_Release,
|
|
|
|
+ /* IXMLHTTPRequest2Callback methods */
|
|
|
|
+ xhr3_callback_OnRedirect,
|
|
|
|
+ xhr3_callback_OnHeadersAvailable,
|
|
|
|
+ xhr3_callback_OnDataAvailable,
|
|
|
|
+ xhr3_callback_OnResponseReceived,
|
|
|
|
+ xhr3_callback_OnError,
|
|
|
|
+ /* IXMLHTTPRequest3Callback methods */
|
|
|
|
+ xhr3_callback_OnServerCertificateReceived,
|
|
|
|
+ xhr3_callback_OnClientCertificateRequested,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static IXMLHTTPRequest2Callback* xhr3_callback_create(HANDLE event)
|
|
|
|
+{
|
|
|
|
+ struct xhr3_callback *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
|
|
|
+ ok(This != NULL, "failed to allocate object\n");
|
|
|
|
+ if (!This) return NULL;
|
|
|
|
+
|
|
|
|
+ This->IXMLHTTPRequest3Callback_iface.lpVtbl = &xhr3_callback_vtbl;
|
|
|
|
+ This->ref = 1;
|
|
|
|
+ This->event = event;
|
|
|
|
+
|
|
|
|
+ return (IXMLHTTPRequest2Callback*)&This->IXMLHTTPRequest3Callback_iface;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+struct xhr2_stream
|
|
|
|
+{
|
|
|
|
+ IStream IStream_iface;
|
|
|
|
+ LONG ref;
|
|
|
|
+ IStream *stream;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static inline struct xhr2_stream *xhr2_stream_from_IStream(IStream *iface)
|
|
|
|
+{
|
|
|
|
+ return CONTAINING_RECORD(iface, struct xhr2_stream, IStream_iface);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_QueryInterface(IStream *iface, REFIID riid, void **obj)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
|
|
|
+ trace("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
+
|
|
|
|
+ if (IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_ISequentialStream) || IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
+ {
|
|
|
|
+ IStream_AddRef(iface);
|
|
|
|
+ *obj = iface;
|
|
|
|
+ return S_OK;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ok(0, "unexpected interface %s\n", debugstr_guid(riid));
|
|
|
|
+ return E_NOINTERFACE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xhr2_stream_AddRef(IStream *iface)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
|
|
|
+ ULONG ref = InterlockedIncrement(&This->ref);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static ULONG WINAPI xhr2_stream_Release(IStream *iface)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
|
|
|
+ ULONG ref = InterlockedDecrement(&This->ref);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%lu)\n", This, ref);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ if (ref == 0)
|
|
|
|
+ {
|
|
|
|
+ IStream_Release(This->stream);
|
|
|
|
+ HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
+ }
|
|
|
|
+ return ref;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Read(IStream *iface, void *pv, ULONG cb,
|
|
|
|
+ ULONG *pcbRead)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbRead);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_Read(This->stream, pv, cb, pcbRead);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Write(IStream *iface, const void *pv,
|
|
|
|
+ ULONG cb, ULONG *pcbWritten)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %lu %p)\n", This, pv, cb, pcbWritten);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_Write(This->stream, pv, cb, pcbWritten);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Seek(IStream *iface, LARGE_INTEGER dlibMove,
|
|
|
|
+ DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%I64u, %lu %p)\n", This, dlibMove.QuadPart, dwOrigin, plibNewPosition);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_Seek(This->stream, dlibMove, dwOrigin, plibNewPosition);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%I64u)\n", This, libNewSize.QuadPart);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_SetSize(This->stream, libNewSize);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_CopyTo(IStream *iface, IStream *pstm,
|
|
|
|
+ ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %I64u %p %p)\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_CopyTo(This->stream, pstm, cb, pcbRead, pcbWritten);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Commit(IStream *iface, DWORD grfCommitFlags)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%#lx)\n", This, grfCommitFlags);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_Commit(This->stream, grfCommitFlags);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Revert(IStream *iface)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
|
|
|
+ trace("(%p)->()\n", This);
|
|
|
|
+ return IStream_Revert(This->stream);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset,
|
|
|
|
+ ULARGE_INTEGER cb, DWORD dwLockType)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_LockRegion(This->stream, libOffset, cb, dwLockType);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset,
|
|
|
|
+ ULARGE_INTEGER cb, DWORD dwLockType)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%I64u %I64u %lu)\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_UnlockRegion(This->stream, libOffset, cb, dwLockType);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("(%p)->(%p %#lx)\n", This, pstatstg, grfStatFlag);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ return IStream_Stat(This->stream, pstatstg, grfStatFlag);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static HRESULT WINAPI xhr2_stream_Clone(IStream *iface, IStream **ppstm)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = xhr2_stream_from_IStream(iface);
|
|
|
|
+ trace("(%p)->(%p)\n", This, ppstm);
|
|
|
|
+ return IStream_Clone(This->stream, ppstm);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static const IStreamVtbl xhr2_stream_vtbl =
|
|
|
|
+{
|
|
|
|
+ xhr2_stream_QueryInterface,
|
|
|
|
+ xhr2_stream_AddRef,
|
|
|
|
+ xhr2_stream_Release,
|
|
|
|
+ /* IStream methods */
|
|
|
|
+ xhr2_stream_Read,
|
|
|
|
+ xhr2_stream_Write,
|
|
|
|
+ xhr2_stream_Seek,
|
|
|
|
+ xhr2_stream_SetSize,
|
|
|
|
+ xhr2_stream_CopyTo,
|
|
|
|
+ xhr2_stream_Commit,
|
|
|
|
+ xhr2_stream_Revert,
|
|
|
|
+ xhr2_stream_LockRegion,
|
|
|
|
+ xhr2_stream_UnlockRegion,
|
|
|
|
+ xhr2_stream_Stat,
|
|
|
|
+ xhr2_stream_Clone
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static ISequentialStream *xhr2_stream_create(void)
|
|
|
|
+{
|
|
|
|
+ struct xhr2_stream *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
|
|
|
|
+ ok(This != NULL, "failed to allocate object\n");
|
|
|
|
+ if (!This) return NULL;
|
|
|
|
+
|
|
|
|
+ This->IStream_iface.lpVtbl = &xhr2_stream_vtbl;
|
|
|
|
+ This->ref = 1;
|
|
|
|
+ CreateStreamOnHGlobal(NULL, TRUE, &This->stream);
|
|
|
|
+
|
|
|
|
+ return (ISequentialStream*)&This->IStream_iface;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void test_IXMLHTTPRequest2(void)
|
|
|
|
+{
|
|
|
|
+ IXMLHTTPRequest2 *xhr2[16];
|
|
|
|
+ IXMLHTTPRequest2Callback *xhr3_callback;
|
|
|
|
+ ISequentialStream *stream;
|
|
|
|
+ HANDLE events[16];
|
|
|
|
+ HRESULT hr;
|
|
|
|
+ int i = 0;
|
|
|
|
+
|
|
|
|
+ if (!(xhr2[i] = create_xhr2()))
|
|
|
|
+ {
|
|
|
|
+ win_skip("IXMLHTTPRequest2 is not available\n");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ events[i] = CreateEventW(NULL, FALSE, FALSE, NULL);
|
|
|
|
+ if (!(xhr3_callback = xhr3_callback_create(events[i])))
|
|
|
|
+ return;
|
|
|
|
+
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("%lu: IXMLHTTPRequest2_Open (%p)->(L\"GET\", L\"http://test.winehq.org/\", xhr3_callback, NULL, NULL, NULL, NULL)\n", GetCurrentThreadId(), xhr2[i]);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ hr = IXMLHTTPRequest2_Open(xhr2[i], L"GET", L"http://test.winehq.org/", xhr3_callback, NULL, NULL, NULL, NULL);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ if ((stream = xhr2_stream_create()))
|
|
|
|
+ {
|
2022-03-15 18:03:11 -07:00
|
|
|
+ trace("%lu: IXMLHTTPRequest2_Send (%p)->(%p 0)\n", GetCurrentThreadId(), xhr2[i], stream);
|
2020-09-08 19:37:05 -07:00
|
|
|
+ hr = IXMLHTTPRequest2_Send(xhr2[i], stream, 0);
|
2022-03-15 18:03:11 -07:00
|
|
|
+ ok(SUCCEEDED(hr), "IXMLHTTPRequest2_Send failed %#lx\n", hr);
|
2020-09-08 19:37:05 -07:00
|
|
|
+
|
|
|
|
+ ISequentialStream_Release(stream);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ IXMLHTTPRequest2Callback_Release(xhr3_callback);
|
|
|
|
+ i++;
|
|
|
|
+
|
|
|
|
+ while (i--)
|
|
|
|
+ {
|
|
|
|
+ WaitForSingleObject(events[i], INFINITE);
|
|
|
|
+ IXMLHTTPRequest2_Release(xhr2[i]);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
START_TEST(httpreq)
|
|
|
|
{
|
|
|
|
IXMLHttpRequest *xhr;
|
|
|
|
|
|
|
|
- CoInitialize(NULL);
|
|
|
|
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
|
|
|
|
|
|
|
if (!(xhr = create_xhr()))
|
|
|
|
{
|
2022-09-03 12:53:05 -07:00
|
|
|
@@ -1923,6 +2311,7 @@ START_TEST(httpreq)
|
2020-09-08 19:37:05 -07:00
|
|
|
test_server_xhr();
|
|
|
|
test_safe_httpreq();
|
|
|
|
test_supporterrorinfo();
|
|
|
|
+ test_IXMLHTTPRequest2();
|
|
|
|
|
|
|
|
CoUninitialize();
|
|
|
|
}
|
2020-09-14 18:15:32 -07:00
|
|
|
diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c
|
2024-03-22 23:27:34 -07:00
|
|
|
index c83e72e136a..c896f1e6a04 100644
|
2020-09-14 18:15:32 -07:00
|
|
|
--- a/dlls/msxml3/tests/schema.c
|
|
|
|
+++ b/dlls/msxml3/tests/schema.c
|
2021-05-18 18:33:46 -07:00
|
|
|
@@ -32,10 +32,16 @@
|
2020-09-14 18:15:32 -07:00
|
|
|
#include "dispex.h"
|
|
|
|
#include "cguid.h"
|
|
|
|
|
|
|
|
+DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
+DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_XMLSchemaCache60, 0x88d96a07, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04);
|
2021-05-18 18:33:46 -07:00
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c);
|
2020-09-14 18:15:32 -07:00
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62);
|
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb);
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
|
|
|
|
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
|
2024-03-22 23:27:34 -07:00
|
|
|
index 7214d23c5dc..320a7e04fa3 100644
|
2020-09-14 18:15:32 -07:00
|
|
|
--- a/dlls/msxml3/uuid.c
|
|
|
|
+++ b/dlls/msxml3/uuid.c
|
2020-10-29 08:47:54 -07:00
|
|
|
@@ -43,6 +43,7 @@
|
|
|
|
|
|
|
|
/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */
|
|
|
|
DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
+DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
2024-03-22 23:27:34 -07:00
|
|
|
@@ -50,6 +51,10 @@ DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x
|
|
|
|
DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
2020-09-14 18:15:32 -07:00
|
|
|
DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
|
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04);
|
2021-05-18 18:33:46 -07:00
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c);
|
2020-09-14 18:15:32 -07:00
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62);
|
|
|
|
+DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note that because of a #define in msxml2.h, we end up initializing
|
2023-10-05 12:53:15 -07:00
|
|
|
diff --git a/include/msxml6.idl b/include/msxml6.idl
|
|
|
|
index 7396826a1f6..b2d8bd3b337 100644
|
|
|
|
--- a/include/msxml6.idl
|
|
|
|
+++ b/include/msxml6.idl
|
|
|
|
@@ -1715,17 +1715,6 @@ interface ISAXDeclHandler : IUnknown
|
|
|
|
[in] int nSystemId);
|
|
|
|
}
|
|
|
|
|
|
|
|
-[
|
|
|
|
- helpstring("Free Threaded XML HTTP Request class 6.0"),
|
|
|
|
- progid("Msxml2.FreeThreadedXMLHTTP60.6.0"),
|
|
|
|
- threading(both),
|
|
|
|
- uuid(88d96a09-f192-11d4-a65f-0040963251e5)
|
|
|
|
-]
|
|
|
|
-coclass FreeThreadedXMLHTTP60
|
|
|
|
-{
|
|
|
|
- [default] interface IXMLHTTPRequest2;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
[
|
|
|
|
object,
|
|
|
|
local,
|
|
|
|
@@ -3053,6 +3042,17 @@ interface ISchemaNotation;
|
|
|
|
SCHEMATYPEVARIETY __schemaTypeVariety__;
|
|
|
|
} __msxml6_ReferenceRemainingTypes__;
|
|
|
|
|
|
|
|
+[
|
|
|
|
+ helpstring("Free Threaded XML HTTP Request class 6.0"),
|
|
|
|
+ progid("Msxml2.FreeThreadedXMLHTTP60.6.0"),
|
|
|
|
+ threading(both),
|
|
|
|
+ uuid(88d96a09-f192-11d4-a65f-0040963251e5)
|
|
|
|
+]
|
|
|
|
+coclass FreeThreadedXMLHTTP60
|
|
|
|
+{
|
|
|
|
+ [default] interface IXMLHTTPRequest2;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
[
|
|
|
|
helpstring("XML DOM Document 6.0"),
|
|
|
|
progid("Msxml2.DOMDocument.6.0"),
|
2020-09-08 19:37:05 -07:00
|
|
|
--
|
2024-03-22 23:27:34 -07:00
|
|
|
2.43.0
|
2020-09-08 19:37:05 -07:00
|
|
|
|