webservices: Implement WS_XML_WRITER_PROPERTY_BUFFERS.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2017-05-15 09:59:24 +02:00 committed by Alexandre Julliard
parent 3f20b66a54
commit 87522d67cf
2 changed files with 22 additions and 5 deletions

View File

@ -1969,6 +1969,7 @@ static void test_WsCopyNode(void)
WS_XML_WRITER *writer;
WS_XML_READER *reader;
WS_XML_BUFFER *buffer;
WS_BUFFERS bufs;
WS_HEAP *heap;
HRESULT hr;
@ -2049,20 +2050,23 @@ static void test_WsCopyNode(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType );
hr = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL );
hr = set_output( writer );
ok( hr == S_OK, "got %08x\n", hr );
hr = WsCopyNode( writer, reader, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output_buffer( buffer, "<v/>", __LINE__ );
check_output( writer, "<v/>", __LINE__ );
hr = WsGetReaderNode( reader, &node, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType );
memset( &bufs, 0, sizeof(bufs) );
hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BUFFERS, &bufs, sizeof(bufs), NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( bufs.bufferCount == 1, "got %u\n", bufs.bufferCount );
ok( bufs.buffers != NULL, "buffers not set\n" );
WsFreeReader( reader );
WsFreeWriter( writer );
WsFreeHeap( heap );

View File

@ -293,6 +293,19 @@ HRESULT WINAPI WsGetWriterProperty( WS_XML_WRITER *handle, WS_XML_WRITER_PROPERT
}
break;
}
case WS_XML_WRITER_PROPERTY_BUFFERS:
if (writer->output_buf->bytes.length)
{
WS_BUFFERS *buffers = buf;
if (size != sizeof(*buffers)) hr = E_INVALIDARG;
else
{
buffers->bufferCount = 1;
buffers->buffers = &writer->output_buf->bytes;
}
break;
}
/* fall through */
default:
hr = prop_get( writer->prop, writer->prop_count, id, buf, size );
}