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
92cb3bc0
Commit
92cb3bc0
authored
Apr 06, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Add support for item ranges.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d53d073e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
21 deletions
+22
-21
reader.c
dlls/webservices/reader.c
+6
-21
reader.c
dlls/webservices/tests/reader.c
+16
-0
No files found.
dlls/webservices/reader.c
View file @
92cb3bc0
...
...
@@ -2581,9 +2581,6 @@ static HRESULT read_type_repeating_element( struct reader *reader, const WS_FIEL
if
(
size
!=
sizeof
(
void
*
))
return
E_INVALIDARG
;
if
(
desc
->
itemRange
)
FIXME
(
"ignoring range (%u-%u)
\n
"
,
desc
->
itemRange
->
minItemCount
,
desc
->
itemRange
->
maxItemCount
);
/* wrapper element */
if
(
desc
->
localName
&&
((
hr
=
read_node
(
reader
))
!=
S_OK
))
return
hr
;
...
...
@@ -2616,29 +2613,17 @@ static HRESULT read_type_repeating_element( struct reader *reader, const WS_FIEL
if
(
desc
->
localName
&&
((
hr
=
read_node
(
reader
))
!=
S_OK
))
return
hr
;
if
(
!
nb_items
)
if
(
desc
->
itemRange
&&
(
nb_items
<
desc
->
itemRange
->
minItemCount
||
nb_items
>
desc
->
itemRange
->
maxItemCount
)
)
{
TRACE
(
"number of items %u out of range (%u-%u)
\n
"
,
nb_items
,
desc
->
itemRange
->
minItemCount
,
desc
->
itemRange
->
maxItemCount
);
ws_free
(
heap
,
buf
);
buf
=
NULL
;
}
switch
(
option
)
{
case
WS_READ_REQUIRED_POINTER
:
if
(
!
nb_items
)
return
WS_E_INVALID_FORMAT
;
/* fall through */
case
WS_READ_OPTIONAL_POINTER
:
if
(
size
!=
sizeof
(
void
*
))
return
E_INVALIDARG
;
*
ret
=
buf
;
break
;
default:
FIXME
(
"read option %u not supported
\n
"
,
option
);
return
E_NOTIMPL
;
return
WS_E_INVALID_FORMAT
;
}
*
count
=
nb_items
;
*
ret
=
buf
;
return
S_OK
;
}
...
...
dlls/webservices/tests/reader.c
View file @
92cb3bc0
...
...
@@ -77,6 +77,9 @@ static const char data12[] =
"<service><id>2</id></service>"
"</services>"
;
static
const
char
data13
[]
=
"<services></services>"
;
static
void
test_WsCreateError
(
void
)
{
HRESULT
hr
;
...
...
@@ -2659,6 +2662,7 @@ static void test_repeating_element(void)
WS_HEAP
*
heap
;
WS_STRUCT_DESCRIPTION
s
,
s2
;
WS_FIELD_DESCRIPTION
f
,
f2
,
*
fields
[
1
],
*
fields2
[
1
];
WS_ITEM_RANGE
range
;
struct
service
{
UINT32
id
;
...
...
@@ -2717,6 +2721,18 @@ static void test_repeating_element(void)
ok
(
test
->
service
[
0
].
id
==
1
,
"got %u
\n
"
,
test
->
service
[
0
].
id
);
ok
(
test
->
service
[
1
].
id
==
2
,
"got %u
\n
"
,
test
->
service
[
1
].
id
);
prepare_struct_type_test
(
reader
,
data13
);
range
.
minItemCount
=
0
;
range
.
maxItemCount
=
1
;
f
.
itemRange
=
&
range
;
test
=
NULL
;
hr
=
WsReadType
(
reader
,
WS_ELEMENT_TYPE_MAPPING
,
WS_STRUCT_TYPE
,
&
s
,
WS_READ_REQUIRED_POINTER
,
heap
,
&
test
,
sizeof
(
test
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
test
!=
NULL
,
"test not set
\n
"
);
ok
(
test
->
service
!=
NULL
,
"service not set
\n
"
);
ok
(
!
test
->
service_count
,
"got %u
\n
"
,
test
->
service_count
);
WsFreeReader
(
reader
);
WsFreeHeap
(
heap
);
}
...
...
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