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:
parent
3f20b66a54
commit
87522d67cf
|
@ -1969,6 +1969,7 @@ static void test_WsCopyNode(void)
|
||||||
WS_XML_WRITER *writer;
|
WS_XML_WRITER *writer;
|
||||||
WS_XML_READER *reader;
|
WS_XML_READER *reader;
|
||||||
WS_XML_BUFFER *buffer;
|
WS_XML_BUFFER *buffer;
|
||||||
|
WS_BUFFERS bufs;
|
||||||
WS_HEAP *heap;
|
WS_HEAP *heap;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
@ -2049,20 +2050,23 @@ static void test_WsCopyNode(void)
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType );
|
ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType );
|
||||||
|
|
||||||
hr = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL );
|
hr = set_output( writer );
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
|
||||||
|
|
||||||
hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL );
|
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
hr = WsCopyNode( writer, reader, NULL );
|
hr = WsCopyNode( writer, reader, NULL );
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
check_output_buffer( buffer, "<v/>", __LINE__ );
|
check_output( writer, "<v/>", __LINE__ );
|
||||||
|
|
||||||
hr = WsGetReaderNode( reader, &node, NULL );
|
hr = WsGetReaderNode( reader, &node, NULL );
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType );
|
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 );
|
WsFreeReader( reader );
|
||||||
WsFreeWriter( writer );
|
WsFreeWriter( writer );
|
||||||
WsFreeHeap( heap );
|
WsFreeHeap( heap );
|
||||||
|
|
|
@ -293,6 +293,19 @@ HRESULT WINAPI WsGetWriterProperty( WS_XML_WRITER *handle, WS_XML_WRITER_PROPERT
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
hr = prop_get( writer->prop, writer->prop_count, id, buf, size );
|
hr = prop_get( writer->prop, writer->prop_count, id, buf, size );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue