Commit ed336395 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

webservices: Implement WsWriteXmlBufferToBytes.

parent 32e20cbf
...@@ -188,6 +188,6 @@ ...@@ -188,6 +188,6 @@
@ stub WsWriteType @ stub WsWriteType
@ stub WsWriteValue @ stub WsWriteValue
@ stdcall WsWriteXmlBuffer(ptr ptr ptr) @ stdcall WsWriteXmlBuffer(ptr ptr ptr)
@ stub WsWriteXmlBufferToBytes @ stdcall WsWriteXmlBufferToBytes(ptr ptr ptr ptr long ptr ptr ptr ptr)
@ stub WsWriteXmlnsAttribute @ stub WsWriteXmlnsAttribute
@ stdcall WsXmlStringEquals(ptr ptr ptr) @ stdcall WsXmlStringEquals(ptr ptr ptr)
...@@ -792,3 +792,41 @@ HRESULT WINAPI WsWriteXmlBuffer( WS_XML_WRITER *handle, WS_XML_BUFFER *buffer, W ...@@ -792,3 +792,41 @@ HRESULT WINAPI WsWriteXmlBuffer( WS_XML_WRITER *handle, WS_XML_BUFFER *buffer, W
write_bytes( writer, xmlbuf->ptr, xmlbuf->size ); write_bytes( writer, xmlbuf->ptr, xmlbuf->size );
return S_OK; return S_OK;
} }
/**************************************************************************
* WsWriteXmlBufferToBytes [webservices.@]
*/
HRESULT WINAPI WsWriteXmlBufferToBytes( WS_XML_WRITER *handle, WS_XML_BUFFER *buffer,
const WS_XML_WRITER_ENCODING *encoding,
const WS_XML_WRITER_PROPERTY *properties, ULONG count,
WS_HEAP *heap, void **bytes, ULONG *size, WS_ERROR *error )
{
struct writer *writer = (struct writer *)handle;
struct xmlbuf *xmlbuf = (struct xmlbuf *)buffer;
HRESULT hr;
char *buf;
ULONG i;
TRACE( "%p %p %p %p %u %p %p %p %p\n", handle, buffer, encoding, properties, count, heap,
bytes, size, error );
if (error) FIXME( "ignoring error parameter\n" );
if (!writer || !xmlbuf || !heap || !bytes) return E_INVALIDARG;
if (encoding && encoding->encodingType != WS_XML_WRITER_ENCODING_TYPE_TEXT)
{
FIXME( "encoding type %u not supported\n", encoding->encodingType );
return E_NOTIMPL;
}
for (i = 0; i < count; i++)
{
hr = set_writer_prop( writer, properties[i].id, properties[i].value, properties[i].valueSize );
if (hr != S_OK) return hr;
}
if (!(buf = ws_alloc( heap, xmlbuf->size ))) return WS_E_QUOTA_EXCEEDED;
memcpy( buf, xmlbuf->ptr, xmlbuf->size );
*bytes = buf;
return S_OK;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment