Author: akhaldi
Date: Sat Jul 2 12:53:37 2016
New Revision: 71725
URL:
http://svn.reactos.org/svn/reactos?rev=71725&view=rev
Log:
[XMLLITE] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/reactos/dll/win32/xmllite/reader.c
trunk/reactos/dll/win32/xmllite/writer.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/xmllite/reader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/xmllite/reader.c…
==============================================================================
--- trunk/reactos/dll/win32/xmllite/reader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/xmllite/reader.c [iso-8859-1] Sat Jul 2 12:53:37 2016
@@ -233,6 +233,7 @@
XmlReaderResumeState resumestate;
XmlNodeType nodetype;
DtdProcessing dtdmode;
+ IXmlResolver *resolver;
UINT line, pos; /* reader position in XML stream */
struct list attrs; /* attributes list for current node */
struct attribute *attr; /* current attribute */
@@ -2462,6 +2463,7 @@
{
IMalloc *imalloc = This->imalloc;
if (This->input)
IUnknown_Release(&This->input->IXmlReaderInput_iface);
+ if (This->resolver) IXmlResolver_Release(This->resolver);
reader_clear_attrs(This);
reader_clear_elements(This);
reader_free_strvalues(This);
@@ -2546,6 +2548,11 @@
switch (property)
{
+ case XmlReaderProperty_XmlResolver:
+ *value = (LONG_PTR)This->resolver;
+ if (This->resolver)
+ IXmlResolver_AddRef(This->resolver);
+ break;
case XmlReaderProperty_DtdProcessing:
*value = This->dtdmode;
break;
@@ -2564,10 +2571,17 @@
{
xmlreader *This = impl_from_IXmlReader(iface);
- TRACE("(%p)->(%s %lu)\n", This, debugstr_reader_prop(property), value);
+ TRACE("(%p)->(%s 0x%lx)\n", This, debugstr_reader_prop(property),
value);
switch (property)
{
+ case XmlReaderProperty_XmlResolver:
+ if (This->resolver)
+ IXmlResolver_Release(This->resolver);
+ This->resolver = (IXmlResolver*)value;
+ if (This->resolver)
+ IXmlResolver_AddRef(This->resolver);
+ break;
case XmlReaderProperty_DtdProcessing:
if (value < 0 || value > _DtdProcessing_Last) return E_INVALIDARG;
This->dtdmode = value;
@@ -2964,6 +2978,7 @@
reader->instate = XmlReadInState_Initial;
reader->resumestate = XmlReadResumeState_Initial;
reader->dtdmode = DtdProcessing_Prohibit;
+ reader->resolver = NULL;
reader->line = reader->pos = 0;
reader->imalloc = imalloc;
if (imalloc) IMalloc_AddRef(imalloc);
Modified: trunk/reactos/dll/win32/xmllite/writer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/xmllite/writer.c…
==============================================================================
--- trunk/reactos/dll/win32/xmllite/writer.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/xmllite/writer.c [iso-8859-1] Sat Jul 2 12:53:37 2016
@@ -33,6 +33,7 @@
static const WCHAR closepiW[] = {'?','>'};
static const WCHAR ltW[] = {'<'};
static const WCHAR gtW[] = {'>'};
+static const WCHAR spaceW[] = {' '};
struct output_buffer
{
@@ -358,6 +359,40 @@
}
writer->bomwritten = TRUE;
+ return S_OK;
+}
+
+static HRESULT write_xmldecl(xmlwriter *writer, XmlStandalone standalone)
+{
+ static const WCHAR versionW[] =
{'<','?','x','m','l','
','v','e','r','s','i','o','n','=','"','1','.','0','"'};
+ static const WCHAR encodingW[] = {'
','e','n','c','o','d','i','n','g','='};
+
+ write_encoding_bom(writer);
+ writer->state = XmlWriterState_DocStarted;
+ if (writer->omitxmldecl) return S_OK;
+
+ /* version */
+ write_output_buffer(writer->output, versionW, ARRAY_SIZE(versionW));
+
+ /* encoding */
+ write_output_buffer(writer->output, encodingW, ARRAY_SIZE(encodingW));
+ write_output_buffer_quoted(writer->output,
get_encoding_name(writer->output->encoding), -1);
+
+ /* standalone */
+ if (standalone == XmlStandalone_Omit)
+ write_output_buffer(writer->output, closepiW, ARRAY_SIZE(closepiW));
+ else {
+ static const WCHAR standaloneW[] = {'
','s','t','a','n','d','a','l','o','n','e','=','\"'};
+ static const WCHAR yesW[] =
{'y','e','s','\"','?','>'};
+ static const WCHAR noW[] =
{'n','o','\"','?','>'};
+
+ write_output_buffer(writer->output, standaloneW, ARRAY_SIZE(standaloneW));
+ if (standalone == XmlStandalone_Yes)
+ write_output_buffer(writer->output, yesW, ARRAY_SIZE(yesW));
+ else
+ write_output_buffer(writer->output, noW, ARRAY_SIZE(noW));
+ }
+
return S_OK;
}
@@ -542,55 +577,37 @@
FIXME("%p %s %s %s %s\n", This, wine_dbgstr_w(pwszPrefix),
wine_dbgstr_w(pwszLocalName),
wine_dbgstr_w(pwszNamespaceUri), wine_dbgstr_w(pwszValue));
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteCData(IXmlWriter *iface, LPCWSTR pwszText)
-{
- xmlwriter *This = impl_from_IXmlWriter(iface);
-
- FIXME("%p %s\n", This, wine_dbgstr_w(pwszText));
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR wch)
-{
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteChars(IXmlWriter *iface, const WCHAR *pwch, UINT
cwch)
-{
- xmlwriter *This = impl_from_IXmlWriter(iface);
-
- FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteComment(IXmlWriter *iface, LPCWSTR pwszComment)
-{
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteDocType(IXmlWriter *iface, LPCWSTR pwszName, LPCWSTR
pwszPublicId,
- LPCWSTR pwszSystemId, LPCWSTR pwszSubset)
-{
- xmlwriter *This = impl_from_IXmlWriter(iface);
-
- FIXME("%p %s %s %s %s\n", This, wine_dbgstr_w(pwszName),
wine_dbgstr_w(pwszPublicId),
- wine_dbgstr_w(pwszSystemId), wine_dbgstr_w(pwszSubset));
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR prefix,
- LPCWSTR local_name, LPCWSTR uri, LPCWSTR value)
-{
- xmlwriter *This = impl_from_IXmlWriter(iface);
-
- TRACE("(%p)->(%s %s %s %s)\n", This, wine_dbgstr_w(prefix),
wine_dbgstr_w(local_name),
- wine_dbgstr_w(uri), wine_dbgstr_w(value));
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ return E_NOTIMPL;
+}
+
+static void write_cdata_section(xmlwriteroutput *output, const WCHAR *data, int len)
+{
+ static const WCHAR cdataopenW[] =
{'<','!','[','C','D','A','T','A','['};
+ static const WCHAR cdatacloseW[] = {']',']','>'};
+ write_output_buffer(output, cdataopenW, ARRAY_SIZE(cdataopenW));
+ if (data)
+ write_output_buffer(output, data, len);
+ write_output_buffer(output, cdatacloseW, ARRAY_SIZE(cdatacloseW));
+}
+
+static HRESULT WINAPI xmlwriter_WriteCData(IXmlWriter *iface, LPCWSTR data)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+ int len;
+
+ TRACE("%p %s\n", This, debugstr_w(data));
switch (This->state)
{
@@ -599,10 +616,154 @@
case XmlWriterState_ElemStarted:
writer_close_starttag(This);
break;
- case XmlWriterState_DocClosed:
- return WR_E_INVALIDACTION;
- default:
- ;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ len = data ? strlenW(data) : 0;
+
+ if (!len)
+ write_cdata_section(This->output, NULL, 0);
+ else {
+ static const WCHAR cdatacloseW[] = {']',']','>',0};
+ while (len) {
+ const WCHAR *str = strstrW(data, cdatacloseW);
+ if (str) {
+ str += 2;
+ write_cdata_section(This->output, data, str - data);
+ len -= str - data;
+ data = str;
+ }
+ else {
+ write_cdata_section(This->output, data, len);
+ break;
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR ch)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ FIXME("%p %x\n", This, ch);
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI xmlwriter_WriteChars(IXmlWriter *iface, const WCHAR *pwch, UINT
cwch)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch);
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI xmlwriter_WriteComment(IXmlWriter *iface, LPCWSTR comment)
+{
+ static const WCHAR copenW[] = {'<','!','-','-'};
+ static const WCHAR ccloseW[] = {'-','-','>'};
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ TRACE("%p %s\n", This, debugstr_w(comment));
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_ElemStarted:
+ writer_close_starttag(This);
+ break;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ write_output_buffer(This->output, copenW, ARRAY_SIZE(copenW));
+ if (comment) {
+ int len = strlenW(comment), i;
+
+ /* Make sure there's no two hyphen sequences in a string, space is used as a
separator to produce compliant
+ comment string */
+ if (len > 1) {
+ for (i = 0; i < len; i++) {
+ write_output_buffer(This->output, comment + i, 1);
+ if (comment[i] == '-' && (i + 1 < len) &&
comment[i+1] == '-')
+ write_output_buffer(This->output, spaceW, ARRAY_SIZE(spaceW));
+ }
+ }
+ else
+ write_output_buffer(This->output, comment, len);
+
+ if (len && comment[len-1] == '-')
+ write_output_buffer(This->output, spaceW, ARRAY_SIZE(spaceW));
+ }
+ write_output_buffer(This->output, ccloseW, ARRAY_SIZE(ccloseW));
+
+ return S_OK;
+}
+
+static HRESULT WINAPI xmlwriter_WriteDocType(IXmlWriter *iface, LPCWSTR pwszName, LPCWSTR
pwszPublicId,
+ LPCWSTR pwszSystemId, LPCWSTR pwszSubset)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ FIXME("%p %s %s %s %s\n", This, wine_dbgstr_w(pwszName),
wine_dbgstr_w(pwszPublicId),
+ wine_dbgstr_w(pwszSystemId), wine_dbgstr_w(pwszSubset));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR prefix,
+ LPCWSTR local_name, LPCWSTR uri, LPCWSTR value)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ TRACE("(%p)->(%s %s %s %s)\n", This, wine_dbgstr_w(prefix),
wine_dbgstr_w(local_name),
+ wine_dbgstr_w(uri), wine_dbgstr_w(value));
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_ElemStarted:
+ writer_close_starttag(This);
+ break;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocStarted:
+ case XmlWriterState_PIDocStarted:
+ break;
+ default:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
}
write_encoding_bom(This);
@@ -624,26 +785,19 @@
static HRESULT WINAPI xmlwriter_WriteEndDocument(IXmlWriter *iface)
{
xmlwriter *This = impl_from_IXmlWriter(iface);
- HRESULT hr = S_OK;
TRACE("%p\n", This);
switch (This->state)
{
case XmlWriterState_Initial:
- hr = E_UNEXPECTED;
- break;
+ return E_UNEXPECTED;
case XmlWriterState_Ready:
case XmlWriterState_DocClosed:
- hr = WR_E_INVALIDACTION;
- break;
- default:
- ;
- }
-
- if (FAILED(hr)) {
This->state = XmlWriterState_DocClosed;
- return hr;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
}
/* empty element stack */
@@ -660,6 +814,18 @@
struct element *element;
TRACE("%p\n", This);
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
element = pop_element(This);
if (!element)
@@ -686,6 +852,16 @@
FIXME("%p %s\n", This, wine_dbgstr_w(pwszName));
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
return E_NOTIMPL;
}
@@ -695,6 +871,18 @@
struct element *element;
TRACE("%p\n", This);
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
element = pop_element(This);
if (!element)
@@ -715,6 +903,18 @@
FIXME("%p %s\n", This, wine_dbgstr_w(pwszName));
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
return E_NOTIMPL;
}
@@ -723,6 +923,18 @@
xmlwriter *This = impl_from_IXmlWriter(iface);
FIXME("%p %s\n", This, wine_dbgstr_w(pwszNmToken));
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
return E_NOTIMPL;
}
@@ -753,7 +965,6 @@
xmlwriter *This = impl_from_IXmlWriter(iface);
static const WCHAR xmlW[] = {'x','m','l',0};
static const WCHAR openpiW[] = {'<','?'};
- static const WCHAR spaceW[] = {' '};
TRACE("(%p)->(%s %s)\n", This, wine_dbgstr_w(name),
wine_dbgstr_w(text));
@@ -792,16 +1003,45 @@
FIXME("%p %s %s\n", This, wine_dbgstr_w(pwszLocalName),
wine_dbgstr_w(pwszNamespaceUri));
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR pwszData)
-{
- xmlwriter *This = impl_from_IXmlWriter(iface);
-
- FIXME("%p %s\n", This, wine_dbgstr_w(pwszData));
-
- return E_NOTIMPL;
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR data)
+{
+ xmlwriter *This = impl_from_IXmlWriter(iface);
+
+ TRACE("%p %s\n", This, debugstr_w(data));
+
+ if (!data)
+ return S_OK;
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ write_xmldecl(This, XmlStandalone_Omit);
+ /* fallthrough */
+ case XmlWriterState_DocStarted:
+ case XmlWriterState_PIDocStarted:
+ break;
+ default:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ }
+
+ write_output_buffer(This->output, data, -1);
+ return S_OK;
}
static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *pwch, UINT
cwch)
@@ -810,13 +1050,21 @@
FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch);
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
+
return E_NOTIMPL;
}
static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandalone
standalone)
{
- static const WCHAR versionW[] =
{'<','?','x','m','l','
','v','e','r','s','i','o','n','=','"','1','.','0','"'};
- static const WCHAR encodingW[] = {'
','e','n','c','o','d','i','n','g','='};
xmlwriter *This = impl_from_IXmlWriter(iface);
TRACE("(%p)->(%d)\n", This, standalone);
@@ -828,41 +1076,14 @@
case XmlWriterState_PIDocStarted:
This->state = XmlWriterState_DocStarted;
return S_OK;
- case XmlWriterState_DocStarted:
- case XmlWriterState_ElemStarted:
- case XmlWriterState_DocClosed:
- return WR_E_INVALIDACTION;
- default:
- ;
- }
-
- write_encoding_bom(This);
- This->state = XmlWriterState_DocStarted;
- if (This->omitxmldecl) return S_OK;
-
- /* version */
- write_output_buffer(This->output, versionW, ARRAY_SIZE(versionW));
-
- /* encoding */
- write_output_buffer(This->output, encodingW, ARRAY_SIZE(encodingW));
- write_output_buffer_quoted(This->output,
get_encoding_name(This->output->encoding), -1);
-
- /* standalone */
- if (standalone == XmlStandalone_Omit)
- write_output_buffer(This->output, closepiW, ARRAY_SIZE(closepiW));
- else {
- static const WCHAR standaloneW[] = {'
','s','t','a','n','d','a','l','o','n','e','=','\"'};
- static const WCHAR yesW[] =
{'y','e','s','\"','?','>'};
- static const WCHAR noW[] =
{'n','o','\"','?','>'};
-
- write_output_buffer(This->output, standaloneW, ARRAY_SIZE(standaloneW));
- if (standalone == XmlStandalone_Yes)
- write_output_buffer(This->output, yesW, ARRAY_SIZE(yesW));
- else
- write_output_buffer(This->output, noW, ARRAY_SIZE(noW));
- }
-
- return S_OK;
+ case XmlWriterState_Ready:
+ break;
+ default:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ }
+
+ return write_xmldecl(This, standalone);
}
static HRESULT WINAPI xmlwriter_WriteStartElement(IXmlWriter *iface, LPCWSTR prefix,
LPCWSTR local_name, LPCWSTR uri)
@@ -871,19 +1092,19 @@
struct element *element;
TRACE("(%p)->(%s %s %s)\n", This, wine_dbgstr_w(prefix),
wine_dbgstr_w(local_name), wine_dbgstr_w(uri));
-
- switch (This->state)
- {
- case XmlWriterState_Initial:
- return E_UNEXPECTED;
- case XmlWriterState_DocClosed:
- return WR_E_INVALIDACTION;
- default:
- ;
- }
if (!local_name)
return E_INVALIDARG;
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_DocClosed:
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
/* close pending element */
if (This->starttagopen)
@@ -910,6 +1131,18 @@
xmlwriter *This = impl_from_IXmlWriter(iface);
FIXME("%p %s\n", This, wine_dbgstr_w(pwszText));
+
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ case XmlWriterState_Ready:
+ case XmlWriterState_DocClosed:
+ This->state = XmlWriterState_DocClosed;
+ return WR_E_INVALIDACTION;
+ default:
+ ;
+ }
return E_NOTIMPL;
}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jul 2 12:53:37 2016
@@ -222,7 +222,7 @@
reactos/dll/win32/xinput1_2 # Synced to WineStaging-1.9.4
reactos/dll/win32/xinput1_3 # Synced to WineStaging-1.9.4
reactos/dll/win32/xinput9_1_0 # Synced to WineStaging-1.9.4
-reactos/dll/win32/xmllite # Synced to WineStaging-1.9.4
+reactos/dll/win32/xmllite # Synced to WineStaging-1.9.11
reactos/dll/cpl/inetcpl # Synced to WineStaging-1.9.4