Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
177d8d78
Commit
177d8d78
authored
May 18, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsReadValue.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec0cae49
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
2 deletions
+73
-2
reader.c
dlls/webservices/reader.c
+18
-0
reader.c
dlls/webservices/tests/reader.c
+52
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices_private.h
dlls/webservices/webservices_private.h
+1
-0
writer.c
dlls/webservices/writer.c
+1
-1
No files found.
dlls/webservices/reader.c
View file @
177d8d78
...
...
@@ -3616,6 +3616,24 @@ HRESULT WINAPI WsReadElement( WS_XML_READER *handle, const WS_ELEMENT_DESCRIPTIO
}
/**************************************************************************
* WsReadValue [webservices.@]
*/
HRESULT
WINAPI
WsReadValue
(
WS_XML_READER
*
handle
,
WS_VALUE_TYPE
value_type
,
void
*
value
,
ULONG
size
,
WS_ERROR
*
error
)
{
struct
reader
*
reader
=
(
struct
reader
*
)
handle
;
WS_TYPE
type
=
map_value_type
(
value_type
);
TRACE
(
"%p %u %p %u %p
\n
"
,
handle
,
type
,
value
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
reader
||
!
value
||
type
==
~
0u
)
return
E_INVALIDARG
;
return
read_type
(
reader
,
WS_ELEMENT_TYPE_MAPPING
,
type
,
NULL
,
NULL
,
NULL
,
WS_READ_REQUIRED_VALUE
,
NULL
,
value
,
size
);
}
/**************************************************************************
* WsSetErrorProperty [webservices.@]
*/
HRESULT
WINAPI
WsSetErrorProperty
(
WS_ERROR
*
handle
,
WS_ERROR_PROPERTY_ID
id
,
const
void
*
value
,
...
...
dlls/webservices/tests/reader.c
View file @
177d8d78
...
...
@@ -3308,6 +3308,57 @@ static void test_WsReadElement(void)
WsFreeReader
(
reader
);
}
static
void
test_WsReadValue
(
void
)
{
HRESULT
hr
;
WS_XML_READER
*
reader
;
UINT32
val
;
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
NULL
)
;
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
"<t>1</t>"
);
hr
=
WsReadValue
(
NULL
,
WS_UINT32_TYPE
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
"<t>1</t>"
);
hr
=
WsReadValue
(
reader
,
WS_UINT32_TYPE
,
NULL
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
/* reader must be positioned correctly */
prepare_struct_type_test
(
reader
,
"<t>1</t>"
);
hr
=
WsReadValue
(
reader
,
WS_UINT32_TYPE
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
"<t>1</t>"
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadValue
(
reader
,
WS_UINT32_TYPE
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
prepare_struct_type_test
(
reader
,
"<t>1</t>"
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadStartElement
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
val
=
0xdeadbeef
;
hr
=
WsReadValue
(
reader
,
WS_UINT32_TYPE
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
val
==
1
,
"got %u
\n
"
,
val
);
prepare_struct_type_test
(
reader
,
"<u t='1'></u>"
);
hr
=
WsReadToStartElement
(
reader
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadValue
(
reader
,
WS_UINT32_TYPE
,
&
val
,
sizeof
(
val
),
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
WsFreeReader
(
reader
);
}
START_TEST
(
reader
)
{
test_WsCreateError
();
...
...
@@ -3338,4 +3389,5 @@ START_TEST(reader)
test_WsFileTimeToDateTime
();
test_double
();
test_WsReadElement
();
test_WsReadValue
();
}
dlls/webservices/webservices.spec
View file @
177d8d78
...
...
@@ -122,7 +122,7 @@
@ stdcall WsReadStartElement(ptr ptr)
@ stdcall WsReadToStartElement(ptr ptr ptr ptr ptr)
@ stdcall WsReadType(ptr long long ptr long ptr ptr long ptr)
@ st
ub WsReadValue
@ st
dcall WsReadValue(ptr long ptr long ptr)
@ stub WsReadXmlBuffer
@ stub WsReadXmlBufferFromBytes
@ stub WsReceiveMessage
...
...
dlls/webservices/webservices_private.h
View file @
177d8d78
...
...
@@ -32,6 +32,7 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *, ULONG ) DECLSPEC_HIDDEN;
WS_XML_UTF8_TEXT
*
alloc_utf8_text
(
const
unsigned
char
*
,
ULONG
)
DECLSPEC_HIDDEN
;
HRESULT
append_attribute
(
WS_XML_ELEMENT_NODE
*
,
WS_XML_ATTRIBUTE
*
)
DECLSPEC_HIDDEN
;
void
free_attribute
(
WS_XML_ATTRIBUTE
*
)
DECLSPEC_HIDDEN
;
WS_TYPE
map_value_type
(
WS_VALUE_TYPE
)
DECLSPEC_HIDDEN
;
struct
node
{
...
...
dlls/webservices/writer.c
View file @
177d8d78
...
...
@@ -1559,7 +1559,7 @@ HRESULT WINAPI WsWriteType( WS_XML_WRITER *handle, WS_TYPE_MAPPING mapping, WS_T
return
hr
;
}
static
WS_TYPE
map_value_type
(
WS_VALUE_TYPE
type
)
WS_TYPE
map_value_type
(
WS_VALUE_TYPE
type
)
{
switch
(
type
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment