[MSXML3] Sync with Wine 3.0. CORE-14225
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 20 Jan 2018 11:35:17 +0000 (12:35 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 20 Jan 2018 11:35:17 +0000 (12:35 +0100)
dll/win32/msxml3/domdoc.c
dll/win32/msxml3/httprequest.c
dll/win32/msxml3/saxreader.c
dll/win32/msxml3/schema.c
media/doc/README.WINE

index b6cdfc7..bb08f25 100644 (file)
@@ -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;
 }
 
index 66a47d5..56bc51a 100644 (file)
@@ -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;
index a68a772..5c8923c 100644 (file)
@@ -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];
 
index 15dfa8d..2c76151 100644 (file)
@@ -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)
index 50ce55e..5cc918b 100644 (file)
@@ -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