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>
This commit is contained in:
parent
06fb21c58a
commit
e87c64f69c
@ -791,6 +791,21 @@ static void test_simple_struct_type(void)
|
|||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
check_output( writer, "<struct>value</struct>", __LINE__ );
|
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 );
|
hr = set_output( writer );
|
||||||
ok( hr == S_OK, "got %08x\n", hr );
|
ok( hr == S_OK, "got %08x\n", hr );
|
||||||
|
|
||||||
|
@ -1695,9 +1695,7 @@ static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TY
|
|||||||
case WS_STRUCT_TYPE:
|
case WS_STRUCT_TYPE:
|
||||||
{
|
{
|
||||||
const void *ptr;
|
const void *ptr;
|
||||||
|
if (!desc) return E_INVALIDARG;
|
||||||
if (!desc || option == WS_WRITE_REQUIRED_VALUE) return E_INVALIDARG;
|
|
||||||
|
|
||||||
if (!option) option = WS_WRITE_REQUIRED_POINTER;
|
if (!option) option = WS_WRITE_REQUIRED_POINTER;
|
||||||
if ((hr = get_value_ptr( option, value, size, (const void **)&ptr )) != S_OK) return hr;
|
if ((hr = get_value_ptr( option, value, size, (const void **)&ptr )) != S_OK) return hr;
|
||||||
return write_type_struct( writer, mapping, desc, ptr );
|
return write_type_struct( writer, mapping, desc, ptr );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user