Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/webservices/channel.c | 30 ++++++++++++++---------------- dlls/webservices/webservices_private.h | 2 +- dlls/webservices/writer.c | 4 ++-- 3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c index 6c7c8affa3..79d431f279 100644 --- a/dlls/webservices/channel.c +++ b/dlls/webservices/channel.c @@ -967,15 +967,6 @@ static HRESULT connect_channel( struct channel *channel ) } }
-static HRESULT write_message( WS_MESSAGE *handle, WS_XML_WRITER *writer, const WS_ELEMENT_DESCRIPTION *desc, - WS_WRITE_OPTION option, const void *body, ULONG size ) -{ - HRESULT hr; - if ((hr = WsWriteEnvelopeStart( handle, writer, NULL, NULL, NULL )) != S_OK) return hr; - if ((hr = WsWriteBody( handle, desc, option, body, size, NULL )) != S_OK) return hr; - return WsWriteEnvelopeEnd( handle, NULL ); -} - static HRESULT send_message_http( HINTERNET request, BYTE *data, ULONG len ) { if (!WinHttpSendRequest( request, NULL, 0, data, len, len, 0 )) @@ -1298,8 +1289,7 @@ static HRESULT init_writer( struct channel *channel ) bin.staticDictionary = (WS_XML_DICTIONARY *)&dict_builtin_static.dict; bin.dynamicStringCallback = dict_cb; bin.dynamicStringCallbackState = &channel->dict_send; - if ((hr = WsSetOutput( channel->writer, &bin.encoding, &buf.output, NULL, 0, NULL )) != S_OK) return hr; - return writer_enable_lookup( channel->writer ); + return WsSetOutput( channel->writer, &bin.encoding, &buf.output, NULL, 0, NULL );
case WS_ENCODING_XML_BINARY_1: return WsSetOutput( channel->writer, &bin.encoding, &buf.output, NULL, 0, NULL ); @@ -1310,6 +1300,17 @@ static HRESULT init_writer( struct channel *channel ) } }
+static HRESULT write_message( struct channel *channel, WS_MESSAGE *msg, const WS_ELEMENT_DESCRIPTION *desc, + WS_WRITE_OPTION option, const void *body, ULONG size ) +{ + HRESULT hr; + if ((hr = writer_set_lookup( channel->writer, TRUE )) != S_OK) return hr; + if ((hr = WsWriteEnvelopeStart( msg, channel->writer, NULL, NULL, NULL )) != S_OK) return hr; + if ((hr = writer_set_lookup( channel->writer, FALSE )) != S_OK) return hr; + if ((hr = WsWriteBody( msg, desc, option, body, size, NULL )) != S_OK) return hr; + return WsWriteEnvelopeEnd( msg, NULL ); +} + /************************************************************************** * WsSendMessage [webservices.@] */ @@ -1339,8 +1340,7 @@ HRESULT WINAPI WsSendMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_MESS 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; + if ((hr = write_message( channel, msg, desc->bodyElementDescription, option, body, size )) != S_OK) goto done; hr = send_message( channel, msg );
done: @@ -1380,13 +1380,11 @@ HRESULT WINAPI WsSendReplyMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS if ((hr = message_set_request_id( msg, &req_id )) != 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; + if ((hr = write_message( channel, msg, 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; }
diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h index cce49cce14..bfc3202a64 100644 --- a/dlls/webservices/webservices_private.h +++ b/dlls/webservices/webservices_private.h @@ -50,7 +50,7 @@ const struct dictionary dict_builtin_static DECLSPEC_HIDDEN; int find_string( const struct dictionary *, const unsigned char *, ULONG, ULONG * ) DECLSPEC_HIDDEN; HRESULT insert_string( struct dictionary *, unsigned char *, ULONG, int, ULONG * ) DECLSPEC_HIDDEN; void clear_dict( struct dictionary * ) DECLSPEC_HIDDEN; -HRESULT writer_enable_lookup( WS_XML_WRITER * ) DECLSPEC_HIDDEN; +HRESULT writer_set_lookup( WS_XML_WRITER *, BOOL ) DECLSPEC_HIDDEN;
const char *debugstr_xmlstr( const WS_XML_STRING * ) DECLSPEC_HIDDEN; WS_XML_STRING *alloc_xml_string( const unsigned char *, ULONG ) DECLSPEC_HIDDEN; diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index 33c1be70b5..b3d130a52c 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -4849,7 +4849,7 @@ done: return hr; }
-HRESULT writer_enable_lookup( WS_XML_WRITER *handle ) +HRESULT writer_set_lookup( WS_XML_WRITER *handle, BOOL enable ) { struct writer *writer = (struct writer *)handle;
@@ -4861,7 +4861,7 @@ HRESULT writer_enable_lookup( WS_XML_WRITER *handle ) return E_INVALIDARG; }
- writer->dict_do_lookup = TRUE; + writer->dict_do_lookup = enable;
LeaveCriticalSection( &writer->cs ); return S_OK;