diff --git a/reactos/dll/win32/xmllite/reader.c b/reactos/dll/win32/xmllite/reader.c index 8d05d8e7399..3ef5f9bb74d 100644 --- a/reactos/dll/win32/xmllite/reader.c +++ b/reactos/dll/win32/xmllite/reader.c @@ -890,8 +890,20 @@ static inline WCHAR *reader_get_ptr(xmlreader *reader) static int reader_cmp(xmlreader *reader, const WCHAR *str) { + int i=0; const WCHAR *ptr = reader_get_ptr(reader); - return strncmpW(str, ptr, strlenW(str)); + while (str[i]) + { + if (!ptr[i]) + { + reader_more(reader); + ptr = reader_get_ptr(reader); + } + if (str[i] != ptr[i]) + return ptr[i] - str[i]; + i++; + } + return 0; } /* moves cursor n WCHARs forward */ diff --git a/reactos/dll/win32/xmllite/writer.c b/reactos/dll/win32/xmllite/writer.c index 19c1f95d679..dc02e21bbbe 100644 --- a/reactos/dll/win32/xmllite/writer.c +++ b/reactos/dll/win32/xmllite/writer.c @@ -49,7 +49,8 @@ typedef enum XmlWriterState_PIDocStarted, /* document was started with manually added 'xml' PI */ XmlWriterState_DocStarted, /* document was started with WriteStartDocument() */ XmlWriterState_ElemStarted, /* writing element */ - XmlWriterState_Content /* content is accepted at this point */ + XmlWriterState_Content, /* content is accepted at this point */ + XmlWriterState_DocClosed /* WriteEndDocument was called */ } XmlWriterState; typedef struct @@ -598,6 +599,8 @@ static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR pr case XmlWriterState_ElemStarted: writer_close_starttag(This); break; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; default: ; } @@ -621,10 +624,34 @@ static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR pr static HRESULT WINAPI xmlwriter_WriteEndDocument(IXmlWriter *iface) { xmlwriter *This = impl_from_IXmlWriter(iface); + HRESULT hr = S_OK; - FIXME("%p\n", This); + TRACE("%p\n", This); - return E_NOTIMPL; + switch (This->state) + { + case XmlWriterState_Initial: + hr = E_UNEXPECTED; + break; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + hr = WR_E_INVALIDACTION; + break; + default: + ; + } + + if (FAILED(hr)) { + This->state = XmlWriterState_DocClosed; + return hr; + } + + /* empty element stack */ + while (IXmlWriter_WriteEndElement(iface) == S_OK) + ; + + This->state = XmlWriterState_DocClosed; + return S_OK; } static HRESULT WINAPI xmlwriter_WriteEndElement(IXmlWriter *iface) @@ -739,6 +766,7 @@ static HRESULT WINAPI xmlwriter_WriteProcessingInstruction(IXmlWriter *iface, LP return WR_E_INVALIDACTION; break; case XmlWriterState_ElemStarted: + case XmlWriterState_DocClosed: return WR_E_INVALIDACTION; default: ; @@ -802,6 +830,7 @@ static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandal return S_OK; case XmlWriterState_DocStarted: case XmlWriterState_ElemStarted: + case XmlWriterState_DocClosed: return WR_E_INVALIDACTION; default: ; @@ -843,8 +872,15 @@ static HRESULT WINAPI xmlwriter_WriteStartElement(IXmlWriter *iface, LPCWSTR pre TRACE("(%p)->(%s %s %s)\n", This, wine_dbgstr_w(prefix), wine_dbgstr_w(local_name), wine_dbgstr_w(uri)); - if (This->state == XmlWriterState_Initial) + switch (This->state) + { + case XmlWriterState_Initial: return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } if (!local_name) return E_INVALIDARG; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 27e7e9a00b5..f3f7f8386bb 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -223,7 +223,7 @@ reactos/dll/win32/xinput1_1 # Synced to WineStaging-1.7.37 reactos/dll/win32/xinput1_2 # Synced to WineStaging-1.7.37 reactos/dll/win32/xinput1_3 # Synced to WineStaging-1.7.37 reactos/dll/win32/xinput9_1_0 # Synced to WineStaging-1.7.37 -reactos/dll/win32/xmllite # Synced to WineStaging-1.7.37 +reactos/dll/win32/xmllite # Synced to WineStaging-1.7.47 reactos/dll/cpl/inetcpl # Synced to WineStaging-1.7.47