winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2017
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
446 discussions
Start a n
N
ew thread
Hans Leidekker : webservices: Parse the MessageID header.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: ab522ac59b0c1c73c96e9fed8edf9462559805c2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab522ac59b0c1c73c96e9fed8…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:13 2017 +0200 webservices: Parse the MessageID header. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/msg.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c index 7b7b526..add5526 100644 --- a/dlls/webservices/msg.c +++ b/dlls/webservices/msg.c @@ -64,6 +64,7 @@ struct msg WS_MESSAGE_INITIALIZATION init; WS_MESSAGE_STATE state; GUID id; + GUID id_req; WS_ENVELOPE_VERSION version_env; WS_ADDRESSING_VERSION version_addr; BOOL is_addressed; @@ -126,6 +127,7 @@ static void reset_msg( struct msg *msg ) msg->state = WS_MESSAGE_STATE_EMPTY; msg->init = 0; UuidCreate( &msg->id ); + memset( &msg->id_req, 0, sizeof(msg->id_req) ); msg->is_addressed = FALSE; heap_free( msg->addr.chars ); msg->addr.chars = NULL; @@ -779,10 +781,31 @@ static BOOL match_current_element( WS_XML_READER *reader, const WS_XML_STRING *l return WsXmlStringEquals( elem->localName, localname, NULL ) == S_OK; } -static HRESULT read_envelope_start( WS_XML_READER *reader ) +static HRESULT read_message_id( WS_XML_READER *reader, GUID *ret ) +{ + const WS_XML_NODE *node; + const WS_XML_TEXT_NODE *text; + const WS_XML_UNIQUE_ID_TEXT *id; + HRESULT hr; + + if ((hr = WsReadNode( reader, NULL )) != S_OK) return hr; + if ((hr = WsGetReaderNode( reader, &node, NULL )) != S_OK) return hr; + if (node->nodeType != WS_XML_NODE_TYPE_TEXT) return WS_E_INVALID_FORMAT; + text = (const WS_XML_TEXT_NODE *)node; + if (text->text->textType != WS_XML_TEXT_TYPE_UNIQUE_ID) + { + FIXME( "unhandled text type %u\n", text->text->textType ); + return E_NOTIMPL; + } + id = (const WS_XML_UNIQUE_ID_TEXT *)text->text; + *ret = id->value; + return S_OK; +} + +static HRESULT read_envelope_start( struct msg *msg, WS_XML_READER *reader ) { static const WS_XML_STRING envelope = {8, (BYTE *)"Envelope"}, body = {4, (BYTE *)"Body"}; - static const WS_XML_STRING header = {6, (BYTE *)"Header"}; + static const WS_XML_STRING header = {6, (BYTE *)"Header"}, msgid = {9, (BYTE *)"MessageID"}; HRESULT hr; if ((hr = WsReadNode( reader, NULL )) != S_OK) return hr; @@ -793,6 +816,8 @@ static HRESULT read_envelope_start( WS_XML_READER *reader ) for (;;) { if ((hr = WsReadNode( reader, NULL )) != S_OK) return hr; + if (match_current_element( reader, &msgid ) && (hr = read_message_id( reader, &msg->id_req )) != S_OK) + return hr; if (match_current_element( reader, &body )) break; } } @@ -833,7 +858,7 @@ HRESULT WINAPI WsReadEnvelopeStart( WS_MESSAGE *handle, WS_XML_READER *reader, W return WS_E_INVALID_OPERATION; } - if ((hr = read_envelope_start( reader )) == S_OK && + if ((hr = read_envelope_start( msg, reader )) == S_OK && (hr = create_header_buffer( reader, msg->heap, &msg->buf )) == S_OK) { msg->reader_body = reader;
1
0
0
0
Hans Leidekker : webservices: Add support for multiple message descriptions in WsReceiveMessage.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: f9ae3097678814408a2f1988db1e00c4aac42d61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9ae3097678814408a2f1988d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:12 2017 +0200 webservices: Add support for multiple message descriptions in WsReceiveMessage. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 29c8108..2b2415a 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1665,26 +1665,12 @@ HRESULT WINAPI WsReceiveMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_M { struct channel *channel = (struct channel *)handle; HRESULT hr; + ULONG i; TRACE( "%p %p %p %u %08x %08x %p %p %u %p %p %p\n", handle, msg, desc, count, option, read_option, heap, value, size, index, ctx, error ); if (error) FIXME( "ignoring error parameter\n" ); if (ctx) FIXME( "ignoring ctx parameter\n" ); - if (index) - { - FIXME( "index parameter not supported\n" ); - return E_NOTIMPL; - } - if (count != 1) - { - FIXME( "no support for multiple descriptions\n" ); - return E_NOTIMPL; - } - if (option != WS_RECEIVE_REQUIRED_MESSAGE) - { - FIXME( "receive option %08x not supported\n", option ); - return E_NOTIMPL; - } if (!channel || !msg || !desc || !count) return E_INVALIDARG; @@ -1696,8 +1682,22 @@ HRESULT WINAPI WsReceiveMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_M return E_INVALIDARG; } - if ((hr = receive_message( channel )) != S_OK) goto done; - hr = read_message( msg, channel->reader, desc[0]->bodyElementDescription, read_option, heap, value, size ); + if (!channel->read_size) hr = receive_message( channel ); + else if (option == WS_RECEIVE_OPTIONAL_MESSAGE) hr = WS_S_END; + else hr = WS_E_INVALID_FORMAT; + + if (hr != S_OK) goto done; + + for (i = 0; i < count; i++) + { + if ((hr = read_message( msg, channel->reader, desc[i]->bodyElementDescription, read_option, heap, + value, size )) == S_OK) + { + if (index) *index = i; + break; + } + if ((hr = init_reader( channel )) != S_OK) break; + } done: LeaveCriticalSection( &channel->cs );
1
0
0
0
Hans Leidekker : webservices: Build a session dictionary for strings not present in the static dictionary.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: e5704b4e1d4280899bce3b714a0729be9b13db81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5704b4e1d4280899bce3b714…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:11 2017 +0200 webservices: Build a session dictionary for strings not present in the static dictionary. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 1300da8..29c8108 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1055,6 +1055,22 @@ HRESULT channel_send_message( WS_CHANNEL *handle, WS_MESSAGE *msg ) return hr; } +static HRESULT CALLBACK dict_cb( void *state, const WS_XML_STRING *str, BOOL *found, ULONG *id, WS_ERROR *error ) +{ + struct dictionary *dict = state; + HRESULT hr = S_OK; + int index; + + if ((index = find_string( dict, str->bytes, str->length, id )) == -1 || + (hr = insert_string( dict, str->bytes, str->length, index, id )) == S_OK) + { + *found = TRUE; + return S_OK; + } + *found = FALSE; + return hr; +} + static HRESULT init_writer( struct channel *channel ) { WS_XML_WRITER_BUFFER_OUTPUT buf = {{WS_XML_WRITER_OUTPUT_TYPE_BUFFER}}; @@ -1073,8 +1089,13 @@ static HRESULT init_writer( struct channel *channel ) break; case WS_ENCODING_XML_BINARY_SESSION_1: - bin.staticDictionary = (WS_XML_DICTIONARY *)&dict_builtin_static.dict; - /* fall through */ + if ((hr = writer_enable_lookup( channel->writer )) != S_OK) return hr; + clear_dict( &channel->dict ); + bin.staticDictionary = (WS_XML_DICTIONARY *)&dict_builtin_static.dict; + bin.dynamicStringCallback = dict_cb; + bin.dynamicStringCallbackState = &channel->dict; + encoding = &bin.encoding; + break; case WS_ENCODING_XML_BINARY_1: encoding = &bin.encoding;
1
0
0
0
Hans Leidekker : webservices: Also use the dictionary for writing UTF-8 text values.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 18a77c327e3f661fd45c923a97e100a16a052c31 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18a77c327e3f661fd45c923a9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:10 2017 +0200 webservices: Also use the dictionary for writing UTF-8 text values. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/writer.c | 75 +++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index 4eba2db..c3de82d 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -653,7 +653,7 @@ static HRESULT write_dict_string( struct writer *writer, ULONG id ) return S_OK; } -static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text ) +static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text, BOOL use_dict ) { if (!text) return RECORD_CHARS8_TEXT; switch (text->textType) @@ -661,6 +661,7 @@ static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text ) case WS_XML_TEXT_TYPE_UTF8: { const WS_XML_UTF8_TEXT *text_utf8 = (const WS_XML_UTF8_TEXT *)text; + if (use_dict) return RECORD_DICTIONARY_TEXT; if (text_utf8->value.length <= MAX_UINT8) return RECORD_CHARS8_TEXT; if (text_utf8->value.length <= MAX_UINT16) return RECORD_CHARS16_TEXT; return RECORD_CHARS32_TEXT; @@ -765,10 +766,36 @@ static INT64 get_text_value_int( const WS_XML_TEXT *text ) } } +static BOOL get_string_id( struct writer *writer, const WS_XML_STRING *str, ULONG *id ) +{ + if (writer->dict && str->dictionary == writer->dict) + { + *id = str->id << 1; + return TRUE; + } + if (writer->dict_cb) + { + BOOL found = FALSE; + writer->dict_cb( writer->dict_cb_state, str, &found, id, NULL ); + if (found) *id = (*id << 1) | 1; + return found; + } + return FALSE; +} + static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TEXT *text ) { - enum record_type type = get_attr_text_record_type( text ); + enum record_type type; + BOOL use_dict = FALSE; HRESULT hr; + ULONG id; + + if (text && text->textType == WS_XML_TEXT_TYPE_UTF8) + { + const WS_XML_UTF8_TEXT *utf8 = (const WS_XML_UTF8_TEXT *)text; + use_dict = get_string_id( writer, &utf8->value, &id ); + } + type = get_attr_text_record_type( text, use_dict ); if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; write_char( writer, type ); @@ -896,23 +923,6 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE } } -static BOOL lookup_string_id( struct writer *writer, const WS_XML_STRING *str, ULONG *id ) -{ - if (writer->dict && str->dictionary == writer->dict) - { - *id = str->id << 1; - return TRUE; - } - if (writer->dict_cb) - { - BOOL found = FALSE; - writer->dict_cb( writer->dict_cb_state, str, &found, id, NULL ); - if (found) *id = (*id << 1) | 1; - return found; - } - return FALSE; -} - static enum record_type get_attr_record_type( const WS_XML_ATTRIBUTE *attr, BOOL use_dict ) { if (!attr->prefix || !attr->prefix->length) @@ -932,7 +942,7 @@ static enum record_type get_attr_record_type( const WS_XML_ATTRIBUTE *attr, BOOL static HRESULT write_attribute_bin( struct writer *writer, const WS_XML_ATTRIBUTE *attr ) { ULONG id; - enum record_type type = get_attr_record_type( attr, lookup_string_id(writer, attr->localName, &id) ); + enum record_type type = get_attr_record_type( attr, get_string_id(writer, attr->localName, &id) ); HRESULT hr; if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; @@ -1080,7 +1090,7 @@ static enum record_type get_xmlns_record_type( const WS_XML_ATTRIBUTE *attr, BOO static HRESULT write_namespace_attribute_bin( struct writer *writer, const WS_XML_ATTRIBUTE *attr ) { ULONG id; - enum record_type type = get_xmlns_record_type( attr, lookup_string_id(writer, attr->ns, &id) ); + enum record_type type = get_xmlns_record_type( attr, get_string_id(writer, attr->ns, &id) ); HRESULT hr; if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; @@ -1299,7 +1309,7 @@ static HRESULT write_startelement_bin( struct writer *writer ) { const WS_XML_ELEMENT_NODE *elem = &writer->current->hdr; ULONG id; - enum record_type type = get_elem_record_type( elem, lookup_string_id(writer, elem->localName, &id) ); + enum record_type type = get_elem_record_type( elem, get_string_id(writer, elem->localName, &id) ); HRESULT hr; if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; @@ -2454,13 +2464,14 @@ static HRESULT write_text_text( struct writer *writer, const WS_XML_TEXT *text, return WS_E_INVALID_FORMAT; } -static enum record_type get_text_record_type( const WS_XML_TEXT *text ) +static enum record_type get_text_record_type( const WS_XML_TEXT *text, BOOL use_dict ) { switch (text->textType) { case WS_XML_TEXT_TYPE_UTF8: { const WS_XML_UTF8_TEXT *text_utf8 = (const WS_XML_UTF8_TEXT *)text; + if (use_dict) return RECORD_DICTIONARY_TEXT_WITH_ENDELEMENT; if (text_utf8->value.length <= MAX_UINT8) return RECORD_CHARS8_TEXT_WITH_ENDELEMENT; if (text_utf8->value.length <= MAX_UINT16) return RECORD_CHARS16_TEXT_WITH_ENDELEMENT; return RECORD_CHARS32_TEXT_WITH_ENDELEMENT; @@ -2537,8 +2548,10 @@ static enum record_type get_text_record_type( const WS_XML_TEXT *text ) static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, ULONG offset ) { - enum record_type type = get_text_record_type( text ); + enum record_type type; + BOOL use_dict = FALSE; HRESULT hr; + ULONG id; if (offset) { @@ -2546,7 +2559,13 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U return E_NOTIMPL; } - switch (type) + if (text->textType == WS_XML_TEXT_TYPE_UTF8) + { + const WS_XML_UTF8_TEXT *utf8 = (const WS_XML_UTF8_TEXT *)text; + use_dict = get_string_id( writer, &utf8->value, &id ); + } + + switch ((type = get_text_record_type( text, use_dict ))) { case RECORD_CHARS8_TEXT_WITH_ENDELEMENT: { @@ -2699,6 +2718,12 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U write_bytes( writer, (const BYTE *)&val, sizeof(val) ); return S_OK; } + case RECORD_DICTIONARY_TEXT_WITH_ENDELEMENT: + { + if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; + write_char( writer, type ); + return write_dict_string( writer, id ); + } default: FIXME( "unhandled record type %02x\n", type ); return E_NOTIMPL;
1
0
0
0
Hans Leidekker : webservices: Add a mechanism to use the builtin static dictionary in the writer.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 7b0a05c15159e4e9412eb9af5be7bb00a164dfbf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b0a05c15159e4e9412eb9af5…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:09 2017 +0200 webservices: Add a mechanism to use the builtin static dictionary in the writer. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/msg.c | 2 +- dlls/webservices/reader.c | 20 +++++++++--------- dlls/webservices/string.c | 7 ++++++- dlls/webservices/webservices_private.h | 3 ++- dlls/webservices/writer.c | 38 ++++++++++++++++++++++++++-------- 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c index 37ce3a3..7b7b526 100644 --- a/dlls/webservices/msg.c +++ b/dlls/webservices/msg.c @@ -1833,7 +1833,7 @@ HRESULT message_set_action( WS_MESSAGE *handle, const WS_XML_STRING *action ) else { WS_XML_STRING *str; - if (!(str = dup_xml_string( action ))) hr = E_OUTOFMEMORY; + if (!(str = dup_xml_string( action, FALSE ))) hr = E_OUTOFMEMORY; else { free_xml_string( msg->action ); diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 50431bf..798e5f7 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -156,9 +156,9 @@ static WS_XML_ATTRIBUTE *dup_attribute( const WS_XML_ATTRIBUTE *src ) dst->isXmlNs = src->isXmlNs; if (!prefix) dst->prefix = NULL; - else if (!(dst->prefix = dup_xml_string( prefix ))) goto error; - if (!(dst->localName = dup_xml_string( localname ))) goto error; - if (!(dst->ns = dup_xml_string( ns ))) goto error; + else if (!(dst->prefix = dup_xml_string( prefix, FALSE ))) goto error; + if (!(dst->localName = dup_xml_string( localname, FALSE ))) goto error; + if (!(dst->ns = dup_xml_string( ns, FALSE ))) goto error; if (text) { @@ -209,9 +209,9 @@ static struct node *dup_element_node( const WS_XML_ELEMENT_NODE *src ) if (count && !(dst->attributes = dup_attributes( attrs, count ))) goto error; dst->attributeCount = count; - if (prefix && !(dst->prefix = dup_xml_string( prefix ))) goto error; - if (localname && !(dst->localName = dup_xml_string( localname ))) goto error; - if (ns && !(dst->ns = dup_xml_string( ns ))) goto error; + if (prefix && !(dst->prefix = dup_xml_string( prefix, FALSE ))) goto error; + if (localname && !(dst->localName = dup_xml_string( localname, FALSE ))) goto error; + if (ns && !(dst->ns = dup_xml_string( ns, FALSE ))) goto error; return node; error: @@ -420,10 +420,10 @@ static HRESULT set_prefix( struct prefix *prefix, const WS_XML_STRING *str, cons if (str) { free_xml_string( prefix->str ); - if (!(prefix->str = dup_xml_string( str ))) return E_OUTOFMEMORY; + if (!(prefix->str = dup_xml_string( str, FALSE ))) return E_OUTOFMEMORY; } if (prefix->ns) free_xml_string( prefix->ns ); - if (!(prefix->ns = dup_xml_string( ns ))) return E_OUTOFMEMORY; + if (!(prefix->ns = dup_xml_string( ns, FALSE ))) return E_OUTOFMEMORY; return S_OK; } @@ -1113,7 +1113,7 @@ static HRESULT parse_qname( const BYTE *str, ULONG len, WS_XML_STRING **prefix_r if ((hr = split_qname( str, len, &prefix, &localname )) != S_OK) return hr; if (!(*prefix_ret = alloc_xml_string( NULL, prefix.length ))) return E_OUTOFMEMORY; - if (!(*localname_ret = dup_xml_string( &localname ))) + if (!(*localname_ret = dup_xml_string( &localname, FALSE ))) { free_xml_string( *prefix_ret ); return E_OUTOFMEMORY; @@ -1821,7 +1821,7 @@ static HRESULT set_namespaces( struct reader *reader, WS_XML_ELEMENT_NODE *elem ULONG i; if (!(ns = get_namespace( reader, elem->prefix ))) return WS_E_INVALID_FORMAT; - if (!(elem->ns = dup_xml_string( ns ))) return E_OUTOFMEMORY; + if (!(elem->ns = dup_xml_string( ns, FALSE ))) return E_OUTOFMEMORY; for (i = 0; i < elem->attributeCount; i++) { diff --git a/dlls/webservices/string.c b/dlls/webservices/string.c index e53a364..75e8b75 100644 --- a/dlls/webservices/string.c +++ b/dlls/webservices/string.c @@ -210,7 +210,7 @@ void free_xml_string( WS_XML_STRING *str ) heap_free( str ); } -WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src ) +WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict ) { WS_XML_STRING *ret; unsigned char *data; @@ -224,6 +224,11 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src ) *ret = *src; return ret; } + if (use_static_dict && (index = find_string( &dict_builtin_static, src->bytes, src->length, &id )) == -1) + { + *ret = dict_builtin_static.dict.strings[id]; + return ret; + } EnterCriticalSection( &dict_cs ); if ((index = find_string( &dict_builtin, src->bytes, src->length, &id )) == -1) { diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h index 958733c..da03213 100644 --- a/dlls/webservices/webservices_private.h +++ b/dlls/webservices/webservices_private.h @@ -51,10 +51,11 @@ int find_string( const struct dictionary *, const unsigned char *, ULONG, ULONG HRESULT insert_string( struct dictionary *, unsigned char *, ULONG, int, ULONG * ) DECLSPEC_HIDDEN; HRESULT CALLBACK insert_string_cb( void *, const WS_XML_STRING *, BOOL *, ULONG *, WS_ERROR * ) DECLSPEC_HIDDEN; void clear_dict( struct dictionary * ) DECLSPEC_HIDDEN; +HRESULT writer_enable_lookup( WS_XML_WRITER * ) DECLSPEC_HIDDEN; const char *debugstr_xmlstr( const WS_XML_STRING * ) DECLSPEC_HIDDEN; WS_XML_STRING *alloc_xml_string( const unsigned char *, ULONG ) DECLSPEC_HIDDEN; -WS_XML_STRING *dup_xml_string( const WS_XML_STRING * ) DECLSPEC_HIDDEN; +WS_XML_STRING *dup_xml_string( const WS_XML_STRING *, BOOL ) DECLSPEC_HIDDEN; HRESULT add_xml_string( WS_XML_STRING * ) DECLSPEC_HIDDEN; void free_xml_string( WS_XML_STRING * ) DECLSPEC_HIDDEN; HRESULT append_attribute( WS_XML_ELEMENT_NODE *, WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN; diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index 7216fc1..4eba2db 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -86,6 +86,7 @@ struct writer struct xmlbuf *output_buf; WS_HEAP *output_heap; const WS_XML_DICTIONARY *dict; + BOOL dict_do_lookup; WS_DYNAMIC_STRING_CALLBACK dict_cb; void *dict_cb_state; ULONG prop_count; @@ -171,6 +172,7 @@ static HRESULT init_writer( struct writer *writer ) writer->output_enc = WS_XML_WRITER_ENCODING_TYPE_TEXT; writer->output_charset = WS_CHARSET_UTF8; writer->dict = NULL; + writer->dict_do_lookup = FALSE; writer->dict_cb = NULL; writer->dict_cb_state = NULL; return S_OK; @@ -1131,12 +1133,12 @@ static HRESULT add_namespace_attribute( struct writer *writer, const WS_XML_STRI attr->singleQuote = !!single; attr->isXmlNs = 1; - if (prefix && !(attr->prefix = dup_xml_string( prefix ))) + if (prefix && !(attr->prefix = dup_xml_string( prefix, writer->dict_do_lookup ))) { free_attribute( attr ); return E_OUTOFMEMORY; } - if (!(attr->ns = dup_xml_string( ns ))) + if (!(attr->ns = dup_xml_string( ns, writer->dict_do_lookup ))) { free_attribute( attr ); return E_OUTOFMEMORY; @@ -1179,7 +1181,7 @@ static BOOL namespace_in_scope( const WS_XML_ELEMENT_NODE *elem, const WS_XML_ST static HRESULT set_current_namespace( struct writer *writer, const WS_XML_STRING *ns ) { WS_XML_STRING *str; - if (!(str = dup_xml_string( ns ))) return E_OUTOFMEMORY; + if (!(str = dup_xml_string( ns, writer->dict_do_lookup ))) return E_OUTOFMEMORY; free_xml_string( writer->current_ns ); writer->current_ns = str; return S_OK; @@ -1545,17 +1547,17 @@ static HRESULT write_add_attribute( struct writer *writer, const WS_XML_STRING * if (!prefix && ns->length) prefix = elem->prefix; attr->singleQuote = !!single; - if (prefix && !(attr->prefix = dup_xml_string( prefix ))) + if (prefix && !(attr->prefix = dup_xml_string( prefix, writer->dict_do_lookup ))) { free_attribute( attr ); return E_OUTOFMEMORY; } - if (!(attr->localName = dup_xml_string( localname ))) + if (!(attr->localName = dup_xml_string( localname, writer->dict_do_lookup ))) { free_attribute( attr ); return E_OUTOFMEMORY; } - if (!(attr->ns = dup_xml_string( ns ))) + if (!(attr->ns = dup_xml_string( ns, writer->dict_do_lookup ))) { free_attribute( attr ); return E_OUTOFMEMORY; @@ -1750,17 +1752,17 @@ static HRESULT write_add_element_node( struct writer *writer, const WS_XML_STRIN if (!(node = alloc_node( WS_XML_NODE_TYPE_ELEMENT ))) return E_OUTOFMEMORY; elem = &node->hdr; - if (prefix && !(elem->prefix = dup_xml_string( prefix ))) + if (prefix && !(elem->prefix = dup_xml_string( prefix, writer->dict_do_lookup ))) { free_node( node ); return E_OUTOFMEMORY; } - if (!(elem->localName = dup_xml_string( localname ))) + if (!(elem->localName = dup_xml_string( localname, writer->dict_do_lookup ))) { free_node( node ); return E_OUTOFMEMORY; } - if (!(elem->ns = dup_xml_string( ns ))) + if (!(elem->ns = dup_xml_string( ns, writer->dict_do_lookup ))) { free_node( node ); return E_OUTOFMEMORY; @@ -4730,3 +4732,21 @@ done: LeaveCriticalSection( &writer->cs ); return hr; } + +HRESULT writer_enable_lookup( WS_XML_WRITER *handle ) +{ + struct writer *writer = (struct writer *)handle; + + EnterCriticalSection( &writer->cs ); + + if (writer->magic != WRITER_MAGIC) + { + LeaveCriticalSection( &writer->cs ); + return E_INVALIDARG; + } + + writer->dict_do_lookup = TRUE; + + LeaveCriticalSection( &writer->cs ); + return S_OK; +}
1
0
0
0
Hans Leidekker : webservices: Store the action header as WS_XML_STRING.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 7727e001783c2042c1ed7fb60300e87ce2b3d84c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7727e001783c2042c1ed7fb60…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:08 2017 +0200 webservices: Store the action header as WS_XML_STRING. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/msg.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c index 8d416eb..37ce3a3 100644 --- a/dlls/webservices/msg.c +++ b/dlls/webservices/msg.c @@ -68,7 +68,7 @@ struct msg WS_ADDRESSING_VERSION version_addr; BOOL is_addressed; WS_STRING addr; - WS_STRING action; + WS_XML_STRING *action; WS_HEAP *heap; WS_XML_BUFFER *buf; WS_XML_WRITER *writer; @@ -131,9 +131,8 @@ static void reset_msg( struct msg *msg ) msg->addr.chars = NULL; msg->addr.length = 0; - heap_free( msg->action.chars ); - msg->action.chars = NULL; - msg->action.length = 0; + free_xml_string( msg->action ); + msg->action = NULL; WsResetHeap( msg->heap, NULL ); msg->buf = NULL; /* allocated on msg->heap */ @@ -546,13 +545,12 @@ static HRESULT write_headers( struct msg *msg, WS_XML_WRITER *writer, const WS_X if ((hr = WsWriteXmlnsAttribute( writer, prefix_addr, ns_addr, FALSE, NULL )) != S_OK) return hr; if ((hr = WsWriteStartElement( writer, prefix_env, &header, ns_env, NULL )) != S_OK) return hr; - if (msg->action.length) + if (msg->action) { - WS_XML_UTF16_TEXT utf16 = {{WS_XML_TEXT_TYPE_UTF16}, (BYTE *)msg->action.chars, - msg->action.length * sizeof(WCHAR)}; + WS_XML_UTF8_TEXT utf8 = {{WS_XML_TEXT_TYPE_UTF8}, {msg->action->length, msg->action->bytes}}; if ((hr = WsWriteStartElement( writer, prefix_addr, action, ns_addr, NULL )) != S_OK) return hr; if ((hr = write_must_understand( writer, prefix_env, ns_env )) != S_OK) return hr; - if ((hr = WsWriteText( writer, &utf16.text, NULL )) != S_OK) return hr; + if ((hr = WsWriteText( writer, &utf8.text, NULL )) != S_OK) return hr; if ((hr = WsWriteEndElement( writer, NULL )) != S_OK) return hr; /* </a:Action> */ } if (msg->addr.length) @@ -600,7 +598,7 @@ static HRESULT write_headers_transport( struct msg *msg, WS_XML_WRITER *writer, HRESULT hr = S_OK; ULONG i; - if ((msg->header_count || !msg->action.length) && + if ((msg->header_count || !msg->action) && (hr = WsWriteStartElement( writer, prefix, &header, ns, NULL )) != S_OK) return hr; for (i = 0; i < msg->header_count; i++) @@ -609,7 +607,7 @@ static HRESULT write_headers_transport( struct msg *msg, WS_XML_WRITER *writer, if ((hr = WsWriteXmlBuffer( writer, msg->header[i]->u.buf, NULL )) != S_OK) return hr; } - if (msg->header_count || !msg->action.length) hr = WsWriteEndElement( writer, NULL ); /* </s:Header> */ + if (msg->header_count || !msg->action) hr = WsWriteEndElement( writer, NULL ); /* </s:Header> */ return hr; } @@ -1681,12 +1679,13 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req ) { static const WCHAR soapactionW[] = {'S','O','A','P','A','c','t','i','o','n',':',' ',0}; - if (!(len = msg->action.length)) break; + if (!(len = MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, NULL, 0 ))) + break; hr = E_OUTOFMEMORY; if (!(buf = heap_alloc( (len + 3) * sizeof(WCHAR) ))) goto done; buf[0] = '"'; - memcpy( buf + 1, msg->action.chars, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + 1, len ); buf[len + 1] = '"'; buf[len + 2] = 0; @@ -1702,12 +1701,13 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req ) static const WCHAR actionW[] = {'a','c','t','i','o','n','=','"'}; ULONG len_action = sizeof(actionW)/sizeof(actionW[0]); - if (!(len = msg->action.length)) break; + if (!(len = MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, NULL, 0 ))) + break; hr = E_OUTOFMEMORY; if (!(buf = heap_alloc( (len + len_action + 2) * sizeof(WCHAR) ))) goto done; memcpy( buf, actionW, len_action * sizeof(WCHAR) ); - memcpy( buf + len_action, msg->action.chars, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + len_action, len ); len += len_action; buf[len++] = '"'; buf[len] = 0; @@ -1827,21 +1827,17 @@ HRESULT message_set_action( WS_MESSAGE *handle, const WS_XML_STRING *action ) if (!action || !action->length) { - heap_free( msg->action.chars ); - msg->action.chars = NULL; - msg->action.length = 0; + free_xml_string( msg->action ); + msg->action = NULL; } else { - WCHAR *chars; - int len = MultiByteToWideChar( CP_UTF8, 0, (char *)action->bytes, action->length, NULL, 0 ); - if (!(chars = heap_alloc( len * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY; + WS_XML_STRING *str; + if (!(str = dup_xml_string( action ))) hr = E_OUTOFMEMORY; else { - MultiByteToWideChar( CP_UTF8, 0, (char *)action->bytes, action->length, chars, len ); - heap_free( msg->action.chars ); - msg->action.chars = chars; - msg->action.length = len; + free_xml_string( msg->action ); + msg->action = str; } }
1
0
0
0
Hans Leidekker : webservices: Return HRESULT from insert_string.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 1a28e34a91b84c8aa6d188a08c398b6436b28045 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a28e34a91b84c8aa6d188a08…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:07 2017 +0200 webservices: Return HRESULT from insert_string. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 4 ++-- dlls/webservices/string.c | 43 +++++++++++++++++----------------- dlls/webservices/webservices_private.h | 2 +- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 87184c7..1300da8 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1497,10 +1497,10 @@ static HRESULT build_dict( const BYTE *buf, ULONG buflen, struct dictionary *dic ptr += size; continue; } - if (!insert_string( dict, bytes, size, index, NULL )) + if ((hr = insert_string( dict, bytes, size, index, NULL )) != S_OK) { clear_dict( dict ); - return E_OUTOFMEMORY; + return hr; } ptr += size; } diff --git a/dlls/webservices/string.c b/dlls/webservices/string.c index 1d1ef61..e53a364 100644 --- a/dlls/webservices/string.c +++ b/dlls/webservices/string.c @@ -87,37 +87,37 @@ int find_string( const struct dictionary *dict, const unsigned char *data, ULONG #define MIN_DICTIONARY_SIZE 256 #define MAX_DICTIONARY_SIZE 2048 -static BOOL grow_dict( struct dictionary *dict, ULONG size ) +static HRESULT grow_dict( struct dictionary *dict, ULONG size ) { WS_XML_STRING *tmp; ULONG new_size, *tmp_sorted; assert( !dict->dict.isConst ); - if (dict->size >= dict->dict.stringCount + size) return TRUE; - if (dict->size + size > MAX_DICTIONARY_SIZE) return FALSE; + if (dict->size >= dict->dict.stringCount + size) return S_OK; + if (dict->size + size > MAX_DICTIONARY_SIZE) return WS_E_QUOTA_EXCEEDED; if (!dict->dict.strings) { new_size = max( MIN_DICTIONARY_SIZE, size ); - if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return FALSE; + if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY; if (!(dict->sorted = heap_alloc( new_size * sizeof(*dict->sorted) ))) { heap_free( dict->dict.strings ); dict->dict.strings = NULL; - return FALSE; + return E_OUTOFMEMORY; } dict->size = new_size; - return TRUE; + return S_OK; } new_size = max( dict->size * 2, size ); - if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return FALSE; + if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY; dict->dict.strings = tmp; - if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return FALSE; + if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY; dict->sorted = tmp_sorted; dict->size = new_size; - return TRUE; + return S_OK; } void clear_dict( struct dictionary *dict ) @@ -133,11 +133,13 @@ void clear_dict( struct dictionary *dict ) dict->size = 0; } -BOOL insert_string( struct dictionary *dict, unsigned char *data, ULONG len, int i, ULONG *ret_id ) +HRESULT insert_string( struct dictionary *dict, unsigned char *data, ULONG len, int i, ULONG *ret_id ) { ULONG id = dict->dict.stringCount; + HRESULT hr; + assert( !dict->dict.isConst ); - if (!grow_dict( dict, 1 )) return FALSE; + if ((hr = grow_dict( dict, 1 )) != S_OK) return hr; memmove( &dict->sorted[i] + 1, &dict->sorted[i], (dict->dict.stringCount - i) * sizeof(*dict->sorted) ); dict->sorted[i] = id; @@ -147,22 +149,24 @@ BOOL insert_string( struct dictionary *dict, unsigned char *data, ULONG len, int dict->dict.strings[id].id = id; dict->dict.stringCount++; if (ret_id) *ret_id = id; - return TRUE; + return S_OK; } HRESULT CALLBACK insert_string_cb( void *state, const WS_XML_STRING *str, BOOL *found, ULONG *id, WS_ERROR *error ) { struct dictionary *dict = state; int index = find_string( dict, str->bytes, str->length, id ); + HRESULT hr = S_OK; assert( !dict->dict.isConst ); - if (index == -1 || insert_string( dict, str->bytes, str->length, index, id )) *found = TRUE; + if (index == -1 || (hr = insert_string( dict, str->bytes, str->length, index, id )) == S_OK) *found = TRUE; else *found = FALSE; - return S_OK; + return hr; } HRESULT add_xml_string( WS_XML_STRING *str ) { + HRESULT hr = S_OK; int index; ULONG id; @@ -172,17 +176,13 @@ HRESULT add_xml_string( WS_XML_STRING *str ) { heap_free( str->bytes ); *str = dict_builtin.dict.strings[id]; - LeaveCriticalSection( &dict_cs ); - return S_OK; } - if (insert_string( &dict_builtin, str->bytes, str->length, index, &id )) + else if ((hr = insert_string( &dict_builtin, str->bytes, str->length, index, &id )) == S_OK) { *str = dict_builtin.dict.strings[id]; - LeaveCriticalSection( &dict_cs ); - return S_OK; } LeaveCriticalSection( &dict_cs ); - return WS_E_QUOTA_EXCEEDED; + return hr; } WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len ) @@ -214,6 +214,7 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src ) { WS_XML_STRING *ret; unsigned char *data; + HRESULT hr; int index; ULONG id; @@ -237,7 +238,7 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src ) return NULL; } memcpy( data, src->bytes, src->length ); - if (insert_string( &dict_builtin, data, src->length, index, &id )) + if ((hr = insert_string( &dict_builtin, data, src->length, index, &id )) == S_OK) { *ret = dict_builtin.dict.strings[id]; LeaveCriticalSection( &dict_cs ); diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h index 9572a02..958733c 100644 --- a/dlls/webservices/webservices_private.h +++ b/dlls/webservices/webservices_private.h @@ -48,7 +48,7 @@ struct dictionary dict_builtin DECLSPEC_HIDDEN; const struct dictionary dict_builtin_static DECLSPEC_HIDDEN; int find_string( const struct dictionary *, const unsigned char *, ULONG, ULONG * ) DECLSPEC_HIDDEN; -BOOL insert_string( struct dictionary *, unsigned char *, ULONG, int, ULONG * ) DECLSPEC_HIDDEN; +HRESULT insert_string( struct dictionary *, unsigned char *, ULONG, int, ULONG * ) DECLSPEC_HIDDEN; HRESULT CALLBACK insert_string_cb( void *, const WS_XML_STRING *, BOOL *, ULONG *, WS_ERROR * ) DECLSPEC_HIDDEN; void clear_dict( struct dictionary * ) DECLSPEC_HIDDEN;
1
0
0
0
Hans Leidekker : webservices: Implement WsSendReplyMessage.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: 19f540dbcb851f698c5718eb9e1255f0ea07074f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19f540dbcb851f698c5718eb9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:06 2017 +0200 webservices: Implement WsSendReplyMessage. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 5db6f1d..87184c7 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -1126,6 +1126,45 @@ done: return hr; } +/************************************************************************** + * WsSendReplyMessage [webservices.@] + */ +HRESULT WINAPI WsSendReplyMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_MESSAGE_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *body, ULONG size, WS_MESSAGE *request, + const WS_ASYNC_CONTEXT *ctx, WS_ERROR *error ) +{ + struct channel *channel = (struct channel *)handle; + HRESULT hr; + + TRACE( "%p %p %p %08x %p %u %p %p %p\n", handle, msg, desc, option, body, size, request, ctx, error ); + if (error) FIXME( "ignoring error parameter\n" ); + if (ctx) FIXME( "ignoring ctx parameter\n" ); + + if (!channel || !msg || !desc || !request) return E_INVALIDARG; + + EnterCriticalSection( &channel->cs ); + + if (channel->magic != CHANNEL_MAGIC) + { + LeaveCriticalSection( &channel->cs ); + return E_INVALIDARG; + } + + if ((hr = WsInitializeMessage( msg, WS_REPLY_MESSAGE, NULL, NULL )) != S_OK) goto done; + if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) goto done; + if ((hr = message_set_action( msg, desc->action )) != S_OK) goto done; + + if ((hr = init_writer( channel )) != S_OK) goto done; + if ((hr = write_message( msg, channel->writer, desc->bodyElementDescription, option, body, size )) != S_OK) + goto done; + hr = send_message( channel, msg ); + +done: + LeaveCriticalSection( &channel->cs ); + FIXME( "returning %08x\n", hr ); + return hr; +} + static HRESULT resize_read_buffer( struct channel *channel, ULONG size ) { if (!channel->read_buf) diff --git a/dlls/webservices/webservices.spec b/dlls/webservices/webservices.spec index 5f9cce8..53fe547 100644 --- a/dlls/webservices/webservices.spec +++ b/dlls/webservices/webservices.spec @@ -144,7 +144,7 @@ @ stub WsRevokeSecurityContext @ stub WsSendFaultMessageForError @ stdcall WsSendMessage(ptr ptr ptr long ptr long ptr ptr) -@ stub WsSendReplyMessage +@ stdcall WsSendReplyMessage(ptr ptr ptr long ptr long ptr ptr ptr) @ stdcall WsSetChannelProperty(ptr long ptr long ptr) @ stdcall WsSetErrorProperty(ptr long ptr long) @ stub WsSetFaultErrorDetail
1
0
0
0
Hans Leidekker : webservices: Store headers in WsReadEnvelopeStart.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: ffbddae5420e6ae33f76f23a7d2af8a1ab5b0b54 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ffbddae5420e6ae33f76f23a7…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 6 15:56:05 2017 +0200 webservices: Store headers in WsReadEnvelopeStart. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/heap.c | 15 +++++++++++---- dlls/webservices/msg.c | 4 ++-- dlls/webservices/reader.c | 29 +++++++++++++++++++++++++++++ dlls/webservices/webservices_private.h | 6 +++++- dlls/webservices/writer.c | 5 +++-- 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/dlls/webservices/heap.c b/dlls/webservices/heap.c index a135cff..1104cf0 100644 --- a/dlls/webservices/heap.c +++ b/dlls/webservices/heap.c @@ -315,21 +315,25 @@ HRESULT WINAPI WsGetHeapProperty( WS_HEAP *handle, WS_HEAP_PROPERTY_ID id, void } #define XML_BUFFER_INITIAL_ALLOCATED_SIZE 256 -struct xmlbuf *alloc_xmlbuf( WS_HEAP *heap, WS_XML_WRITER_ENCODING_TYPE encoding, WS_CHARSET charset ) +struct xmlbuf *alloc_xmlbuf( WS_HEAP *heap, SIZE_T size, WS_XML_WRITER_ENCODING_TYPE encoding, WS_CHARSET charset, + const WS_XML_DICTIONARY *dict_static, WS_XML_DICTIONARY *dict ) { struct xmlbuf *ret; + if (!size) size = XML_BUFFER_INITIAL_ALLOCATED_SIZE; if (!(ret = ws_alloc( heap, sizeof(*ret) ))) return NULL; - if (!(ret->bytes.bytes = ws_alloc( heap, XML_BUFFER_INITIAL_ALLOCATED_SIZE ))) + if (!(ret->bytes.bytes = ws_alloc( heap, size ))) { ws_free( heap, ret, sizeof(*ret) ); return NULL; } ret->heap = heap; - ret->size = XML_BUFFER_INITIAL_ALLOCATED_SIZE; + ret->size = size; ret->bytes.length = 0; ret->encoding = encoding; ret->charset = charset; + ret->dict_static = dict_static; + ret->dict = dict; return ret; } @@ -348,10 +352,13 @@ HRESULT WINAPI WsCreateXmlBuffer( WS_HEAP *heap, const WS_XML_BUFFER_PROPERTY *p { struct xmlbuf *xmlbuf; + TRACE( "%p %p %u %p %p\n", heap, properties, count, handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + if (!heap || !handle) return E_INVALIDARG; if (count) FIXME( "properties not implemented\n" ); - if (!(xmlbuf = alloc_xmlbuf( heap, WS_XML_WRITER_ENCODING_TYPE_TEXT, WS_CHARSET_UTF8 ))) + if (!(xmlbuf = alloc_xmlbuf( heap, 0, WS_XML_WRITER_ENCODING_TYPE_TEXT, WS_CHARSET_UTF8, NULL, NULL ))) { return WS_E_QUOTA_EXCEEDED; } diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c index d6f0144..8d416eb 100644 --- a/dlls/webservices/msg.c +++ b/dlls/webservices/msg.c @@ -794,7 +794,6 @@ static HRESULT read_envelope_start( WS_XML_READER *reader ) { for (;;) { - /* FIXME: store headers */ if ((hr = WsReadNode( reader, NULL )) != S_OK) return hr; if (match_current_element( reader, &body )) break; } @@ -836,7 +835,8 @@ HRESULT WINAPI WsReadEnvelopeStart( WS_MESSAGE *handle, WS_XML_READER *reader, W return WS_E_INVALID_OPERATION; } - if ((hr = read_envelope_start( reader )) == S_OK) + if ((hr = read_envelope_start( reader )) == S_OK && + (hr = create_header_buffer( reader, msg->heap, &msg->buf )) == S_OK) { msg->reader_body = reader; msg->state = WS_MESSAGE_STATE_READING; diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 0028334..50431bf 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -6931,6 +6931,8 @@ HRESULT WINAPI WsSetInputToBuffer( WS_XML_READER *handle, WS_XML_BUFFER *buffer, reader->input_enc = xmlbuf->encoding; reader->input_charset = xmlbuf->charset; + reader->dict_static = xmlbuf->dict_static; + reader->dict = xmlbuf->dict; set_input_buffer( reader, xmlbuf, xmlbuf->bytes.bytes, xmlbuf->bytes.length ); if (!(node = alloc_node( WS_XML_NODE_TYPE_BOF ))) hr = E_OUTOFMEMORY; @@ -7268,6 +7270,33 @@ done: return hr; } +HRESULT create_header_buffer( WS_XML_READER *handle, WS_HEAP *heap, WS_XML_BUFFER **ret ) +{ + struct reader *reader = (struct reader *)handle; + HRESULT hr = WS_E_QUOTA_EXCEEDED; + struct xmlbuf *xmlbuf; + + EnterCriticalSection( &reader->cs ); + + if (reader->magic != READER_MAGIC) + { + LeaveCriticalSection( &reader->cs ); + return E_INVALIDARG; + } + + if ((xmlbuf = alloc_xmlbuf( heap, reader->read_pos, reader->input_enc, reader->input_charset, + reader->dict_static, reader->dict ))) + { + memcpy( xmlbuf->bytes.bytes, reader->read_bufptr, reader->read_pos ); + xmlbuf->bytes.length = reader->read_pos; + *ret = (WS_XML_BUFFER *)xmlbuf; + hr = S_OK; + } + + LeaveCriticalSection( &reader->cs ); + return hr; +} + HRESULT get_param_desc( const WS_STRUCT_DESCRIPTION *desc, USHORT index, const WS_FIELD_DESCRIPTION **ret ) { if (index >= desc->fieldCount) return E_INVALIDARG; diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h index 5ce88b2..9572a02 100644 --- a/dlls/webservices/webservices_private.h +++ b/dlls/webservices/webservices_private.h @@ -25,6 +25,8 @@ struct xmlbuf SIZE_T size; WS_XML_WRITER_ENCODING_TYPE encoding; WS_CHARSET charset; + const WS_XML_DICTIONARY *dict_static; + WS_XML_DICTIONARY *dict; }; void *ws_alloc( WS_HEAP *, SIZE_T ) DECLSPEC_HIDDEN; @@ -32,7 +34,8 @@ void *ws_alloc_zero( WS_HEAP *, SIZE_T ) DECLSPEC_HIDDEN; void *ws_realloc( WS_HEAP *, void *, SIZE_T, SIZE_T ) DECLSPEC_HIDDEN; void *ws_realloc_zero( WS_HEAP *, void *, SIZE_T, SIZE_T ) DECLSPEC_HIDDEN; void ws_free( WS_HEAP *, void *, SIZE_T ) DECLSPEC_HIDDEN; -struct xmlbuf *alloc_xmlbuf( WS_HEAP *, WS_XML_WRITER_ENCODING_TYPE, WS_CHARSET ) DECLSPEC_HIDDEN; +struct xmlbuf *alloc_xmlbuf( WS_HEAP *, SIZE_T, WS_XML_WRITER_ENCODING_TYPE, WS_CHARSET, + const WS_XML_DICTIONARY *, WS_XML_DICTIONARY * ) DECLSPEC_HIDDEN; void free_xmlbuf( struct xmlbuf * ) DECLSPEC_HIDDEN; struct dictionary @@ -62,6 +65,7 @@ void restore_fpword( unsigned short ) DECLSPEC_HIDDEN; ULONG get_type_size( WS_TYPE, const void * ) DECLSPEC_HIDDEN; HRESULT read_header( WS_XML_READER *, const WS_XML_STRING *, const WS_XML_STRING *, WS_TYPE, const void *, WS_READ_OPTION, WS_HEAP *, void *, ULONG ) DECLSPEC_HIDDEN; +HRESULT create_header_buffer( WS_XML_READER *, WS_HEAP *, WS_XML_BUFFER ** ) DECLSPEC_HIDDEN; WS_XML_UTF8_TEXT *alloc_utf8_text( const BYTE *, ULONG ) DECLSPEC_HIDDEN; WS_XML_UTF16_TEXT *alloc_utf16_text( const BYTE *, ULONG ) DECLSPEC_HIDDEN; diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index 2071a95..7216fc1 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -85,7 +85,7 @@ struct writer WS_XML_WRITER_OUTPUT_TYPE output_type; struct xmlbuf *output_buf; WS_HEAP *output_heap; - WS_XML_DICTIONARY *dict; + const WS_XML_DICTIONARY *dict; WS_DYNAMIC_STRING_CALLBACK dict_cb; void *dict_cb_state; ULONG prop_count; @@ -408,7 +408,8 @@ HRESULT WINAPI WsSetOutput( WS_XML_WRITER *handle, const WS_XML_WRITER_ENCODING case WS_XML_WRITER_OUTPUT_TYPE_BUFFER: { struct xmlbuf *xmlbuf; - if (!(xmlbuf = alloc_xmlbuf( writer->output_heap, writer->output_enc, writer->output_charset ))) + if (!(xmlbuf = alloc_xmlbuf( writer->output_heap, 0, writer->output_enc, writer->output_charset, + writer->dict, NULL ))) { hr = WS_E_QUOTA_EXCEEDED; goto done;
1
0
0
0
Matteo Bruni : wined3d: Don' t take the upload path for blits to formats requiring conversion.
by Alexandre Julliard
06 Sep '17
06 Sep '17
Module: wine Branch: master Commit: a55d384264fae9741ed3eb901bafe6ff19c75a52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a55d384264fae9741ed3eb901…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Sep 6 01:39:19 2017 +0200 wined3d: Don't take the upload path for blits to formats requiring conversion. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 11438c4..608447f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3716,6 +3716,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst TRACE("Not doing upload because of scaling.\n"); else if (convert) TRACE("Not doing upload because of format conversion.\n"); + else if (dst_texture->resource.format->convert) + TRACE("Not doing upload because the destination format needs conversion.\n"); else { POINT dst_point = {dst_rect->left, dst_rect->top};
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
45
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Results per page:
10
25
50
100
200