Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
d53d073e
Commit
d53d073e
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: Pass exact size in read_type_struct_field.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b4a73f74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
reader.c
dlls/webservices/reader.c
+13
-6
webservices_private.h
dlls/webservices/webservices_private.h
+0
-1
writer.c
dlls/webservices/writer.c
+1
-1
No files found.
dlls/webservices/reader.c
View file @
d53d073e
...
...
@@ -2579,6 +2579,8 @@ static HRESULT read_type_repeating_element( struct reader *reader, const WS_FIEL
ULONG
item_size
,
nb_items
=
0
,
nb_allocated
=
1
,
offset
=
0
;
char
*
buf
;
if
(
size
!=
sizeof
(
void
*
))
return
E_INVALIDARG
;
if
(
desc
->
itemRange
)
FIXME
(
"ignoring range (%u-%u)
\n
"
,
desc
->
itemRange
->
minItemCount
,
desc
->
itemRange
->
maxItemCount
);
...
...
@@ -2627,7 +2629,7 @@ static HRESULT read_type_repeating_element( struct reader *reader, const WS_FIEL
/* fall through */
case
WS_READ_OPTIONAL_POINTER
:
if
(
size
<
sizeof
(
void
*
))
return
E_INVALIDARG
;
if
(
size
!=
sizeof
(
void
*
))
return
E_INVALIDARG
;
*
ret
=
buf
;
break
;
...
...
@@ -2686,14 +2688,20 @@ static WS_READ_OPTION map_field_options( WS_TYPE type, ULONG options )
}
static
HRESULT
read_type_struct_field
(
struct
reader
*
reader
,
const
WS_FIELD_DESCRIPTION
*
desc
,
WS_HEAP
*
heap
,
char
*
buf
,
ULONG
size
)
WS_HEAP
*
heap
,
char
*
buf
)
{
char
*
ptr
=
buf
+
desc
->
offset
;
WS_READ_OPTION
option
;
ULONG
size
;
HRESULT
hr
;
if
(
!
(
option
=
map_field_options
(
desc
->
type
,
desc
->
options
)))
return
E_INVALIDARG
;
if
(
option
==
WS_READ_REQUIRED_VALUE
)
size
=
get_type_size
(
desc
->
type
,
desc
->
typeDescription
);
else
size
=
sizeof
(
void
*
);
switch
(
desc
->
mapping
)
{
case
WS_ATTRIBUTE_FIELD_MAPPING
:
...
...
@@ -2750,7 +2758,7 @@ static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping,
const
WS_STRUCT_DESCRIPTION
*
desc
,
WS_READ_OPTION
option
,
WS_HEAP
*
heap
,
void
*
ret
,
ULONG
size
)
{
ULONG
i
,
field_size
;
ULONG
i
;
HRESULT
hr
;
char
*
buf
;
...
...
@@ -2766,7 +2774,7 @@ static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping,
{
case
WS_READ_REQUIRED_POINTER
:
case
WS_READ_OPTIONAL_POINTER
:
if
(
size
<
sizeof
(
void
*
))
return
E_INVALIDARG
;
if
(
size
!=
sizeof
(
void
*
))
return
E_INVALIDARG
;
if
(
!
(
buf
=
ws_alloc_zero
(
heap
,
desc
->
size
)))
return
WS_E_QUOTA_EXCEEDED
;
break
;
...
...
@@ -2782,8 +2790,7 @@ static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping,
for
(
i
=
0
;
i
<
desc
->
fieldCount
;
i
++
)
{
field_size
=
get_field_size
(
desc
,
i
);
if
((
hr
=
read_type_struct_field
(
reader
,
desc
->
fields
[
i
],
heap
,
buf
,
field_size
))
!=
S_OK
)
if
((
hr
=
read_type_struct_field
(
reader
,
desc
->
fields
[
i
],
heap
,
buf
))
!=
S_OK
)
break
;
}
...
...
dlls/webservices/webservices_private.h
View file @
d53d073e
...
...
@@ -32,7 +32,6 @@ 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
;
ULONG
get_field_size
(
const
WS_STRUCT_DESCRIPTION
*
,
ULONG
)
DECLSPEC_HIDDEN
;
struct
node
{
...
...
dlls/webservices/writer.c
View file @
d53d073e
...
...
@@ -1378,7 +1378,7 @@ static HRESULT write_type_struct_field( struct writer *writer, const WS_FIELD_DE
return
S_OK
;
}
ULONG
get_field_size
(
const
WS_STRUCT_DESCRIPTION
*
desc
,
ULONG
index
)
static
ULONG
get_field_size
(
const
WS_STRUCT_DESCRIPTION
*
desc
,
ULONG
index
)
{
if
(
index
<
desc
->
fieldCount
-
1
)
return
desc
->
fields
[
index
+
1
]
->
offset
-
desc
->
fields
[
index
]
->
offset
;
return
desc
->
size
-
desc
->
fields
[
index
]
->
offset
;
...
...
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