From 28dd2e11d4837bbb9ec9abdd160540eb6f0d34e4 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Thu, 29 Jun 2017 09:22:05 +0200 Subject: [PATCH] webservices: Handle text records with implicit end element. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- 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 aec0d37385d..1024c8575a7 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 4894223a5f7..19385871642 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