[MSXML3] Sync with Wine Staging 1.9.16. CORE-11866
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 18 Aug 2016 10:27:06 +0000 (10:27 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 18 Aug 2016 10:27:06 +0000 (10:27 +0000)
svn path=/trunk/; revision=72296

reactos/dll/win32/msxml3/httprequest.c
reactos/dll/win32/msxml3/saxreader.c
reactos/dll/win32/msxml3/schema.c
reactos/dll/win32/msxml3/xmlparser.c
reactos/media/doc/README.WINE

index 85f72f7..66a47d5 100644 (file)
@@ -90,7 +90,6 @@ typedef struct
 {
     httprequest req;
     IServerXMLHTTPRequest IServerXMLHTTPRequest_iface;
-    LONG ref;
 } serverhttp;
 
 static inline httprequest *impl_from_IXMLHTTPRequest( IXMLHTTPRequest *iface )
@@ -1536,19 +1535,19 @@ static HRESULT WINAPI
 httprequest_ObjectWithSite_QueryInterface( IObjectWithSite* iface, REFIID riid, void** ppvObject )
 {
     httprequest *This = impl_from_IObjectWithSite(iface);
-    return IXMLHTTPRequest_QueryInterface( (IXMLHTTPRequest *)This, riid, ppvObject );
+    return IXMLHTTPRequest_QueryInterface(&This->IXMLHTTPRequest_iface, riid, ppvObject);
 }
 
 static ULONG WINAPI httprequest_ObjectWithSite_AddRef( IObjectWithSite* iface )
 {
     httprequest *This = impl_from_IObjectWithSite(iface);
-    return IXMLHTTPRequest_AddRef((IXMLHTTPRequest *)This);
+    return IXMLHTTPRequest_AddRef(&This->IXMLHTTPRequest_iface);
 }
 
 static ULONG WINAPI httprequest_ObjectWithSite_Release( IObjectWithSite* iface )
 {
     httprequest *This = impl_from_IObjectWithSite(iface);
-    return IXMLHTTPRequest_Release((IXMLHTTPRequest *)This);
+    return IXMLHTTPRequest_Release(&This->IXMLHTTPRequest_iface);
 }
 
 static HRESULT WINAPI httprequest_ObjectWithSite_GetSite( IObjectWithSite *iface, REFIID iid, void **ppvSite )
@@ -1632,19 +1631,19 @@ static const IObjectWithSiteVtbl ObjectWithSiteVtbl =
 static HRESULT WINAPI httprequest_Safety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
 {
     httprequest *This = impl_from_IObjectSafety(iface);
-    return IXMLHTTPRequest_QueryInterface( (IXMLHTTPRequest *)This, riid, ppv );
+    return IXMLHTTPRequest_QueryInterface(&This->IXMLHTTPRequest_iface, riid, ppv);
 }
 
 static ULONG WINAPI httprequest_Safety_AddRef(IObjectSafety *iface)
 {
     httprequest *This = impl_from_IObjectSafety(iface);
-    return IXMLHTTPRequest_AddRef((IXMLHTTPRequest *)This);
+    return IXMLHTTPRequest_AddRef(&This->IXMLHTTPRequest_iface);
 }
 
 static ULONG WINAPI httprequest_Safety_Release(IObjectSafety *iface)
 {
     httprequest *This = impl_from_IObjectSafety(iface);
-    return IXMLHTTPRequest_Release((IXMLHTTPRequest *)This);
+    return IXMLHTTPRequest_Release(&This->IXMLHTTPRequest_iface);
 }
 
 static HRESULT WINAPI httprequest_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid,
@@ -1713,7 +1712,7 @@ static HRESULT WINAPI ServerXMLHTTPRequest_QueryInterface(IServerXMLHTTPRequest
 static ULONG WINAPI ServerXMLHTTPRequest_AddRef(IServerXMLHTTPRequest *iface)
 {
     serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
-    ULONG ref = InterlockedIncrement( &This->ref );
+    ULONG ref = InterlockedIncrement( &This->req.ref );
     TRACE("(%p)->(%u)\n", This, ref );
     return ref;
 }
@@ -1721,7 +1720,7 @@ static ULONG WINAPI ServerXMLHTTPRequest_AddRef(IServerXMLHTTPRequest *iface)
 static ULONG WINAPI ServerXMLHTTPRequest_Release(IServerXMLHTTPRequest *iface)
 {
     serverhttp *This = impl_from_IServerXMLHTTPRequest( iface );
-    ULONG ref = InterlockedDecrement( &This->ref );
+    ULONG ref = InterlockedDecrement( &This->req.ref );
 
     TRACE("(%p)->(%u)\n", This, ref );
 
@@ -2017,7 +2016,6 @@ HRESULT ServerXMLHTTP_create(void **obj)
 
     init_httprequest(&req->req);
     req->IServerXMLHTTPRequest_iface.lpVtbl = &ServerXMLHTTPRequestVtbl;
-    req->ref = 1;
 
     *obj = &req->IServerXMLHTTPRequest_iface;
 
index 5da05f2..90d8c21 100644 (file)
@@ -2500,7 +2500,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz
     if (encoding == XML_CHAR_ENCODING_NONE)
     {
         const WCHAR *ptr = (WCHAR*)buffer;
-        /* xml declaration with possibly specified encoding will be still handled by parser */
+        /* an xml declaration with optional encoding will still be handled by the parser */
         if ((size >= 2) && *ptr == '<' && ptr[1] != '?')
         {
             enc_name = (xmlChar*)xmlGetCharEncodingName(XML_CHAR_ENCODING_UTF16LE);
index 30225a9..15dfa8d 100644 (file)
@@ -1227,7 +1227,30 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
                 IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode);
 
                 if (domnode)
-                    doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
+                {
+                    DOMNodeType type;
+
+                    IXMLDOMNode_get_nodeType(domnode, &type);
+                    switch (type)
+                    {
+                    case NODE_ELEMENT:
+                    {
+                        IXMLDOMDocument *domdoc;
+                        VARIANT_BOOL b;
+                        BSTR xml;
+
+                        IXMLDOMNode_get_xml(domnode, &xml);
+                        DOMDocument_create(This->version, (void**)&domdoc);
+                        IXMLDOMDocument_loadXML(domdoc, xml, &b);
+                        SysFreeString(xml);
+                        doc = xmlNodePtr_from_domnode((IXMLDOMNode*)domdoc, XML_DOCUMENT_NODE)->doc;
+                        break;
+                    }
+                    default:
+                        doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
+                        break;
+                    }
+                }
 
                 if (!doc)
                 {
index 0f515bb..74709c4 100644 (file)
@@ -31,6 +31,7 @@ typedef struct _xmlparser
     LONG ref;
 
     int flags;
+    XML_PARSER_STATE state;
 } xmlparser;
 
 static inline xmlparser *impl_from_IXMLParser( IXMLParser *iface )
@@ -325,9 +326,9 @@ static HRESULT WINAPI xmlparser_GetParserState(IXMLParser *iface)
 {
     xmlparser *This = impl_from_IXMLParser( iface );
 
-    FIXME("(%p)\n", This);
+    TRACE("(%p)\n", This);
 
-    return E_NOTIMPL;
+    return This->state;
 }
 
 static HRESULT WINAPI xmlparser_Suspend(IXMLParser *iface)
@@ -427,6 +428,7 @@ HRESULT XMLParser_create(void **ppObj)
     This->nodefactory = NULL;
     This->input = NULL;
     This->flags = 0;
+    This->state = XMLPARSER_IDLE;
     This->ref = 1;
 
     *ppObj = &This->IXMLParser_iface;
index cbd7325..f4ce338 100644 (file)
@@ -131,7 +131,7 @@ reactos/dll/win32/msvfw32             # Synced to WineStaging-1.9.16
 reactos/dll/win32/msvidc32            # Synced to WineStaging-1.9.11
 reactos/dll/win32/msxml               # Synced to WineStaging-1.9.11
 reactos/dll/win32/msxml2              # Synced to WineStaging-1.9.11
-reactos/dll/win32/msxml3              # Synced to WineStaging-1.9.11
+reactos/dll/win32/msxml3              # Synced to WineStaging-1.9.16
 reactos/dll/win32/msxml4              # Synced to WineStaging-1.9.11
 reactos/dll/win32/msxml6              # Synced to WineStaging-1.9.11
 reactos/dll/win32/nddeapi             # Synced to WineStaging-1.9.11