Module: wine Branch: master Commit: 419604e15babda4fdbc326da6952f4c9486a3292 URL: http://source.winehq.org/git/wine.git/?a=commit;h=419604e15babda4fdbc326da69...
Author: Hans Leidekker hans@codeweavers.com Date: Tue May 30 10:09:08 2017 +0200
webservices: Implement WsGetDictionary.
Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/webservices/reader.c | 18 +++++++++++++++++ dlls/webservices/tests/reader.c | 41 ++++++++++++++++++++++++++++++++++++++- dlls/webservices/webservices.spec | 2 +- 3 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 01b464f..d59de3b 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -86,6 +86,24 @@ static WS_XML_DICTIONARY dict_builtin = {0x82704485,0x222a,0x4f7c,{0xb9,0x7b,0xe9,0xa4,0x62,0xa9,0x66,0x2b}} };
+/************************************************************************** + * WsGetDictionary [webservices.@] + */ +HRESULT WINAPI WsGetDictionary( WS_ENCODING encoding, WS_XML_DICTIONARY **dict, WS_ERROR *error ) +{ + TRACE( "%u %p %p\n", encoding, dict, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!dict) return E_INVALIDARG; + + if (encoding == WS_ENCODING_XML_BINARY_1 || encoding == WS_ENCODING_XML_BINARY_SESSION_1) + *dict = &dict_builtin; + else + *dict = NULL; + + return S_OK; +} + static inline int cmp_string( const unsigned char *str, ULONG len, const unsigned char *str2, ULONG len2 ) { if (len < len2) return -1; diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c index 0e21e86..87f593f 100644 --- a/dlls/webservices/tests/reader.c +++ b/dlls/webservices/tests/reader.c @@ -1183,6 +1183,7 @@ static void test_WsReadNode(void) static const char str17[] = "<!--comment-->"; HRESULT hr; WS_XML_READER *reader; + WS_XML_DICTIONARY *dict; const WS_XML_NODE *node; unsigned int i; int found; @@ -1334,6 +1335,21 @@ static void test_WsReadNode(void) ok( !memcmp( comment->value.bytes, " comment ", 9 ), "wrong data\n" ); }
+ dict = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_UTF8, &dict, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict == NULL, "got %p\n", dict ); + + dict = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_BINARY_1, &dict, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict != NULL, "dict not set\n" ); + + dict = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_BINARY_SESSION_1, &dict, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict != NULL, "dict not set\n" ); + WsFreeReader( reader ); }
@@ -4898,7 +4914,7 @@ static void test_dictionary(void) const WS_XML_ATTRIBUTE *attr; const WS_XML_UTF8_TEXT *utf8; WS_XML_STRING strings[6]; - WS_XML_DICTIONARY dict; + WS_XML_DICTIONARY dict, *dict2; WS_XML_READER *reader; HRESULT hr;
@@ -5163,6 +5179,29 @@ static void test_dictionary(void) ok( hr == S_OK, "got %08x\n", hr ); ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType );
+ hr = WsGetDictionary( 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsGetDictionary( WS_ENCODING_XML_UTF8, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + dict2 = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_UTF8, &dict2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict2 == NULL, "got %p\n", dict2 ); + + dict2 = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_BINARY_1, &dict2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict2 != NULL, "dict2 not set\n" ); + ok( dict2 != &dict, "got %p\n", dict2 ); + + dict2 = (WS_XML_DICTIONARY *)0xdeadbeef; + hr = WsGetDictionary( WS_ENCODING_XML_BINARY_SESSION_1, &dict2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( dict2 != NULL, "dict2 not set\n" ); + ok( dict2 != &dict, "got %p\n", dict2 ); + WsFreeReader( reader ); }
diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index 1f98aa3..c88935a 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -61,7 +61,7 @@ @ stdcall WsFreeWriter(ptr) @ stdcall WsGetChannelProperty(ptr long ptr long ptr) @ stub WsGetCustomHeader -@ stub WsGetDictionary +@ stdcall WsGetDictionary(long ptr ptr) @ stdcall WsGetErrorProperty(ptr long ptr long) @ stdcall WsGetErrorString(ptr long ptr) @ stub WsGetFaultErrorDetail