https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0506c9332a4f7c18b4de5…
commit 0506c9332a4f7c18b4de547db823c8e6cd1a6a28
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Jan 20 12:35:17 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Jan 20 12:35:17 2018 +0100
[MSXML3] Sync with Wine 3.0. CORE-14225
---
dll/win32/msxml3/domdoc.c | 42 ++++++++++++++++++++++++++++--
dll/win32/msxml3/httprequest.c | 58 +++++++++++++++++++++++++++++++++++++++---
dll/win32/msxml3/saxreader.c | 3 ++-
dll/win32/msxml3/schema.c | 2 +-
media/doc/README.WINE | 2 +-
5 files changed, 99 insertions(+), 8 deletions(-)
diff --git a/dll/win32/msxml3/domdoc.c b/dll/win32/msxml3/domdoc.c
index b6cdfc760b..bb08f25a13 100644
--- a/dll/win32/msxml3/domdoc.c
+++ b/dll/win32/msxml3/domdoc.c
@@ -1486,10 +1486,48 @@ static HRESULT WINAPI domdoc_get_baseName(
static HRESULT WINAPI domdoc_transformNodeToObject(
IXMLDOMDocument3 *iface,
IXMLDOMNode* stylesheet,
- VARIANT outputObject)
+ VARIANT output)
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
- FIXME("(%p)->(%p %s)\n", This, stylesheet,
debugstr_variant(&outputObject));
+
+ TRACE("(%p)->(%p %s)\n", This, stylesheet,
debugstr_variant(&output));
+
+ switch (V_VT(&output))
+ {
+ case VT_UNKNOWN:
+ case VT_DISPATCH:
+ {
+ IXMLDOMDocument *doc;
+ HRESULT hr;
+
+ if (!V_UNKNOWN(&output))
+ return E_INVALIDARG;
+
+ /* FIXME: we're not supposed to query for document interface, should use
IStream
+ which we don't support currently. */
+ if (IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_IXMLDOMDocument,
(void **)&doc) == S_OK)
+ {
+ VARIANT_BOOL b;
+ BSTR str;
+
+ if (FAILED(hr = node_transform_node(&This->node, stylesheet,
&str)))
+ return hr;
+
+ hr = IXMLDOMDocument_loadXML(doc, str, &b);
+ SysFreeString(str);
+ return hr;
+ }
+ else
+ {
+ FIXME("Unsupported destination type.\n");
+ return E_INVALIDARG;
+ }
+ }
+ default:
+ FIXME("Output type %d not handled.\n", V_VT(&output));
+ return E_NOTIMPL;
+ }
+
return E_NOTIMPL;
}
diff --git a/dll/win32/msxml3/httprequest.c b/dll/win32/msxml3/httprequest.c
index 66a47d545e..56bc51a932 100644
--- a/dll/win32/msxml3/httprequest.c
+++ b/dll/win32/msxml3/httprequest.c
@@ -49,6 +49,7 @@ typedef struct
IXMLHTTPRequest IXMLHTTPRequest_iface;
IObjectWithSite IObjectWithSite_iface;
IObjectSafety IObjectSafety_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
LONG ref;
READYSTATE state;
@@ -107,6 +108,11 @@ static inline httprequest *impl_from_IObjectSafety(IObjectSafety
*iface)
return CONTAINING_RECORD(iface, httprequest, IObjectSafety_iface);
}
+static inline httprequest *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
+{
+ return CONTAINING_RECORD(iface, httprequest, ISupportErrorInfo_iface);
+}
+
static inline serverhttp *impl_from_IServerXMLHTTPRequest(IServerXMLHTTPRequest *iface)
{
return CONTAINING_RECORD(iface, serverhttp, IServerXMLHTTPRequest_iface);
@@ -856,6 +862,7 @@ static HRESULT verify_uri(httprequest *This, IUri *uri)
static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR url,
VARIANT async, VARIANT user, VARIANT password)
{
+ static const WCHAR MethodHeadW[] =
{'H','E','A','D',0};
static const WCHAR MethodGetW[] = {'G','E','T',0};
static const WCHAR MethodPutW[] = {'P','U','T',0};
static const WCHAR MethodPostW[] =
{'P','O','S','T',0};
@@ -891,6 +898,7 @@ static HRESULT httprequest_open(httprequest *This, BSTR method, BSTR
url,
This->verb = BINDVERB_POST;
}
else if (!strcmpiW(method, MethodDeleteW) ||
+ !strcmpiW(method, MethodHeadW) ||
!strcmpiW(method, MethodPropFindW))
{
This->verb = BINDVERB_CUSTOM;
@@ -1303,6 +1311,10 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest
*iface, REFI
{
*ppvObject = &This->IObjectSafety_iface;
}
+ else if (IsEqualGUID(&IID_ISupportErrorInfo, riid))
+ {
+ *ppvObject = &This->ISupportErrorInfo_iface;
+ }
else
{
TRACE("Unsupported interface %s\n", debugstr_guid(riid));
@@ -1310,7 +1322,7 @@ static HRESULT WINAPI XMLHTTPRequest_QueryInterface(IXMLHTTPRequest
*iface, REFI
return E_NOINTERFACE;
}
- IXMLHTTPRequest_AddRef( iface );
+ IUnknown_AddRef((IUnknown *)*ppvObject);
return S_OK;
}
@@ -1683,6 +1695,41 @@ static const IObjectSafetyVtbl ObjectSafetyVtbl = {
httprequest_Safety_SetInterfaceSafetyOptions
};
+static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID
riid, void **obj)
+{
+ httprequest *This = impl_from_ISupportErrorInfo(iface);
+ return IXMLHTTPRequest_QueryInterface(&This->IXMLHTTPRequest_iface, riid,
obj);
+}
+
+static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
+{
+ httprequest *This = impl_from_ISupportErrorInfo(iface);
+ return IXMLHTTPRequest_AddRef(&This->IXMLHTTPRequest_iface);
+}
+
+static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
+{
+ httprequest *This = impl_from_ISupportErrorInfo(iface);
+ return IXMLHTTPRequest_Release(&This->IXMLHTTPRequest_iface);
+}
+
+static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo
*iface, REFIID riid)
+{
+ httprequest *This = impl_from_ISupportErrorInfo(iface);
+
+ FIXME("(%p)->(%s)\n", This, debugstr_guid(riid));
+
+ return E_NOTIMPL;
+}
+
+static const ISupportErrorInfoVtbl SupportErrorInfoVtbl =
+{
+ SupportErrorInfo_QueryInterface,
+ SupportErrorInfo_AddRef,
+ SupportErrorInfo_Release,
+ SupportErrorInfo_InterfaceSupportsErrorInfo,
+};
+
/* IServerXMLHTTPRequest */
static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest *iface,
REFIID riid, void **obj)
{
@@ -1697,6 +1744,10 @@ static HRESULT WINAPI
ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
{
*obj = iface;
}
+ else if ( IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &This->req.ISupportErrorInfo_iface;
+ }
else
{
TRACE("Unsupported interface %s\n", debugstr_guid(riid));
@@ -1704,7 +1755,7 @@ static HRESULT WINAPI
ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
return E_NOINTERFACE;
}
- IServerXMLHTTPRequest_AddRef( iface );
+ IUnknown_AddRef( (IUnknown *)*obj );
return S_OK;
}
@@ -1903,7 +1954,7 @@ static HRESULT WINAPI
ServerXMLHTTPRequest_setTimeouts(IServerXMLHTTPRequest *if
{
serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
FIXME("(%p)->(%d %d %d %d): stub\n", This, resolveTimeout,
connectTimeout, sendTimeout, receiveTimeout);
- return E_NOTIMPL;
+ return S_OK;
}
static HRESULT WINAPI ServerXMLHTTPRequest_waitForResponse(IServerXMLHTTPRequest *iface,
VARIANT timeout, VARIANT_BOOL *isSuccessful)
@@ -1961,6 +2012,7 @@ static void init_httprequest(httprequest *req)
req->IXMLHTTPRequest_iface.lpVtbl = &XMLHTTPRequestVtbl;
req->IObjectWithSite_iface.lpVtbl = &ObjectWithSiteVtbl;
req->IObjectSafety_iface.lpVtbl = &ObjectSafetyVtbl;
+ req->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl;
req->ref = 1;
req->async = FALSE;
diff --git a/dll/win32/msxml3/saxreader.c b/dll/win32/msxml3/saxreader.c
index a68a7725d2..5c8923caac 100644
--- a/dll/win32/msxml3/saxreader.c
+++ b/dll/win32/msxml3/saxreader.c
@@ -1950,6 +1950,7 @@ static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len)
BSTR bstr = bstr_from_xmlCharN(str, len), ret;
WCHAR *ptr;
+ len = SysStringLen(bstr);
ptr = bstr + len - 1;
while ((*ptr == '\r' || *ptr == '\n') && ptr >= bstr)
ptr--;
@@ -2016,7 +2017,7 @@ static void libxml_cdatablock(void *ctx, const xmlChar *value, int
len)
while (i < len)
{
if (value[i] != '\r' && value[i] != '\n') break;
- i++;
+ i++;
}
end = &value[i];
diff --git a/dll/win32/msxml3/schema.c b/dll/win32/msxml3/schema.c
index 15dfa8d54e..2c761518bd 100644
--- a/dll/win32/msxml3/schema.c
+++ b/dll/win32/msxml3/schema.c
@@ -789,7 +789,7 @@ static inline schema_cache*
impl_from_IXMLDOMSchemaCollection2(IXMLDOMSchemaColl
static inline schema_cache* impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection*
iface)
{
- return CONTAINING_RECORD((IXMLDOMSchemaCollection2 *)iface, schema_cache,
IXMLDOMSchemaCollection2_iface);
+ return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface);
}
static inline schema_cache*
unsafe_impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface)
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 50ce55e84b..5cc918b237 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -129,7 +129,7 @@ reactos/dll/win32/msvfw32 # Synced to Wine-3.0
reactos/dll/win32/msvidc32 # Synced to Wine-3.0
reactos/dll/win32/msxml # Synced to WineStaging-2.9
reactos/dll/win32/msxml2 # Synced to WineStaging-2.9
-reactos/dll/win32/msxml3 # Synced to WineStaging-2.9
+reactos/dll/win32/msxml3 # Synced to Wine-3.0
reactos/dll/win32/msxml4 # Synced to WineStaging-2.9
reactos/dll/win32/msxml6 # Synced to WineStaging-2.9
reactos/dll/win32/nddeapi # Synced to WineStaging-2.9