[v2 7/7] webservices: Handle text records with implicit end element.

Hans Leidekker hans at codeweavers.com
Thu Jun 29 02:22:05 CDT 2017


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/webservices/reader.c              | 11 +++++++----
 dlls/webservices/webservices_private.h |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index aec0d37..1024c85 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -2171,6 +2171,7 @@ static HRESULT read_text_bin( struct reader *reader )
         }
     }
 
+    if (type & 1) node->flags |= NODE_FLAG_TEXT_WITH_IMPLICIT_END_ELEMENT;
     read_insert_node( reader, parent, node );
     reader->state = READER_STATE_TEXT;
     reader->text_conv_offset = 0;
@@ -2349,9 +2350,11 @@ static HRESULT read_endelement_bin( struct reader *reader )
     unsigned char type;
     HRESULT hr;
 
-    if ((hr = read_byte( reader, &type )) != S_OK) return hr;
-    if (type != RECORD_ENDELEMENT) return WS_E_INVALID_FORMAT;
-
+    if (!(reader->current->flags & NODE_FLAG_TEXT_WITH_IMPLICIT_END_ELEMENT))
+    {
+        if ((hr = read_byte( reader, &type )) != S_OK) return hr;
+        if (type != RECORD_ENDELEMENT) return WS_E_INVALID_FORMAT;
+    }
     if (!(parent = find_parent( reader ))) return WS_E_INVALID_FORMAT;
 
     reader->current = LIST_ENTRY( list_tail( &parent->children ), struct node, entry );
@@ -2559,7 +2562,7 @@ static HRESULT read_node_bin( struct reader *reader )
     unsigned char type;
     HRESULT hr;
 
-    if (node_type( reader->current ) == WS_XML_NODE_TYPE_TEXT)
+    if (reader->current->flags & NODE_FLAG_TEXT_WITH_IMPLICIT_END_ELEMENT)
     {
         reader->current = LIST_ENTRY( list_tail( &reader->current->parent->children ), struct node, entry );
         reader->last    = reader->current;
diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h
index 4894223..1938587 100644
--- a/dlls/webservices/webservices_private.h
+++ b/dlls/webservices/webservices_private.h
@@ -81,6 +81,7 @@ HRESULT read_output_params( WS_XML_READER *, WS_HEAP *, const WS_ELEMENT_DESCRIP
 enum node_flag
 {
     NODE_FLAG_IGNORE_TRAILING_ELEMENT_CONTENT   = 0x1,
+    NODE_FLAG_TEXT_WITH_IMPLICIT_END_ELEMENT    = 0x2,
 };
 
 struct node
-- 
2.1.4




More information about the wine-patches mailing list