From bd4361cb0f050e2928a20953d632d316095f829f Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 29 Jan 2016 13:27:29 +0100 Subject: [PATCH] webservices: Implement WsReadStartAttribute. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/webservices/reader.c | 24 ++++++++++++++++++++++++ dlls/webservices/webservices.spec | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 13ca50bba1a..82a3a1af969 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -378,6 +378,7 @@ enum reader_state READER_STATE_INITIAL, READER_STATE_BOF, READER_STATE_STARTELEMENT, + READER_STATE_STARTATTRIBUTE, READER_STATE_STARTENDELEMENT, READER_STATE_TEXT, READER_STATE_ENDELEMENT, @@ -393,6 +394,7 @@ struct reader enum reader_state state; struct node *root; struct node *current; + ULONG current_attr; WS_XML_READER_INPUT_TYPE input_type; const unsigned char *input_data; ULONG input_size; @@ -1341,6 +1343,28 @@ HRESULT WINAPI WsMoveReader( WS_XML_READER *handle, WS_MOVE_TO move, BOOL *found return read_move_to( reader, move, found ); } +/************************************************************************** + * WsReadStartAttribute [webservices.@] + */ +HRESULT WINAPI WsReadStartAttribute( WS_XML_READER *handle, ULONG index, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + WS_XML_ELEMENT_NODE *elem; + + TRACE( "%p %u %p\n", handle, index, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader) return E_INVALIDARG; + + elem = &reader->current->hdr; + if (reader->state != READER_STATE_STARTELEMENT || index >= elem->attributeCount) + return WS_E_INVALID_FORMAT; + + reader->current_attr = index; + reader->state = READER_STATE_STARTATTRIBUTE; + return S_OK; +} + static WCHAR *xmltext_to_widechar( WS_HEAP *heap, const WS_XML_TEXT *text ) { WCHAR *ret; diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index 6931f77f317..062af8d1aad 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -118,7 +118,7 @@ @ stub WsReadMetadata @ stdcall WsReadNode(ptr ptr) @ stub WsReadQualifiedName -@ stub WsReadStartAttribute +@ stdcall WsReadStartAttribute(ptr long ptr) @ stdcall WsReadStartElement(ptr ptr) @ stdcall WsReadToStartElement(ptr ptr ptr ptr ptr) @ stdcall WsReadType(ptr long long ptr long ptr ptr long ptr)