webservices: Allow structures to be passed by value in WsWriteType.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Hans Leidekker 2016-08-25 20:02:48 +02:00 committed by Alexandre Julliard
parent 06fb21c58a
commit e87c64f69c
2 changed files with 16 additions and 3 deletions

View File

@ -791,6 +791,21 @@ static void test_simple_struct_type(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<struct>value</struct>", __LINE__ );
/* required value */
hr = set_output( writer );
ok( hr == S_OK, "got %08x\n", hr );
hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL );
ok( hr == S_OK, "got %08x\n", hr );
hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s,
WS_WRITE_REQUIRED_VALUE, test, sizeof(*test), NULL );
ok( hr == S_OK, "got %08x\n", hr );
hr = WsWriteEndElement( writer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<struct>value</struct>", __LINE__ );
hr = set_output( writer );
ok( hr == S_OK, "got %08x\n", hr );

View File

@ -1695,9 +1695,7 @@ static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TY
case WS_STRUCT_TYPE:
{
const void *ptr;
if (!desc || option == WS_WRITE_REQUIRED_VALUE) return E_INVALIDARG;
if (!desc) return E_INVALIDARG;
if (!option) option = WS_WRITE_REQUIRED_POINTER;
if ((hr = get_value_ptr( option, value, size, (const void **)&ptr )) != S_OK) return hr;
return write_type_struct( writer, mapping, desc, ptr );