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
b85e6800
Commit
b85e6800
authored
Jul 12, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Add support for GUID records in the writer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30abce87
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
17 deletions
+39
-17
reader.c
dlls/webservices/reader.c
+9
-6
webservices_private.h
dlls/webservices/webservices_private.h
+4
-4
writer.c
dlls/webservices/writer.c
+26
-7
No files found.
dlls/webservices/reader.c
View file @
b85e6800
...
...
@@ -1541,7 +1541,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if
(
!
(
text_utf8
=
alloc_utf8_text
(
str
->
bytes
,
str
->
length
)))
return
E_OUTOFMEMORY
;
break
;
case
RECORD_UNIQUEID_TEXT
:
case
RECORD_UNIQUE
_
ID_TEXT
:
{
WS_XML_UNIQUE_ID_TEXT
*
text_unique_id
;
if
((
hr
=
read_bytes
(
reader
,
(
unsigned
char
*
)
&
guid
,
sizeof
(
guid
)
))
!=
S_OK
)
return
hr
;
...
...
@@ -1549,7 +1549,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
attr
->
value
=
&
text_unique_id
->
text
;
return
S_OK
;
}
case
RECORD_
U
UID_TEXT
:
case
RECORD_
G
UID_TEXT
:
{
WS_XML_GUID_TEXT
*
guid_text
;
if
((
hr
=
read_bytes
(
reader
,
(
unsigned
char
*
)
&
guid
,
sizeof
(
guid
)
))
!=
S_OK
)
return
hr
;
...
...
@@ -2446,14 +2446,14 @@ static HRESULT read_text_bin( struct reader *reader )
if
(
!
(
node
=
alloc_utf8_text_node
(
str
->
bytes
,
str
->
length
,
NULL
)))
return
E_OUTOFMEMORY
;
break
;
}
case
RECORD_UNIQUEID_TEXT
:
case
RECORD_UNIQUEID_TEXT_WITH_ENDELEMENT
:
case
RECORD_UNIQUE
_
ID_TEXT
:
case
RECORD_UNIQUE
_
ID_TEXT_WITH_ENDELEMENT
:
if
((
hr
=
read_bytes
(
reader
,
(
unsigned
char
*
)
&
uuid
,
sizeof
(
uuid
)
))
!=
S_OK
)
return
hr
;
if
(
!
(
node
=
alloc_unique_id_text_node
(
&
uuid
)))
return
E_OUTOFMEMORY
;
break
;
case
RECORD_
U
UID_TEXT
:
case
RECORD_
U
UID_TEXT_WITH_ENDELEMENT
:
case
RECORD_
G
UID_TEXT
:
case
RECORD_
G
UID_TEXT_WITH_ENDELEMENT
:
if
((
hr
=
read_bytes
(
reader
,
(
unsigned
char
*
)
&
uuid
,
sizeof
(
uuid
)
))
!=
S_OK
)
return
hr
;
if
(
!
(
node
=
alloc_guid_text_node
(
&
uuid
)))
return
E_OUTOFMEMORY
;
break
;
...
...
@@ -5857,6 +5857,9 @@ ULONG get_type_size( WS_TYPE type, const void *desc )
case
WS_GUID_TYPE
:
return
sizeof
(
GUID
);
case
WS_UNIQUE_ID_TYPE
:
return
sizeof
(
WS_UNIQUE_ID
);
case
WS_STRING_TYPE
:
return
sizeof
(
WS_STRING
);
...
...
dlls/webservices/webservices_private.h
View file @
b85e6800
...
...
@@ -317,12 +317,12 @@ enum record_type
RECORD_EMPTY_TEXT_WITH_ENDELEMENT
=
0xa9
,
RECORD_DICTIONARY_TEXT
=
0xaa
,
RECORD_DICTIONARY_TEXT_WITH_ENDELEMENT
=
0xab
,
RECORD_UNIQUE
ID_TEXT
=
0xac
,
RECORD_UNIQUE
ID_TEXT_WITH_ENDELEMENT
=
0xad
,
RECORD_UNIQUE
_ID_TEXT
=
0xac
,
RECORD_UNIQUE
_ID_TEXT_WITH_ENDELEMENT
=
0xad
,
RECORD_TIMESPAN_TEXT
=
0xae
,
RECORD_TIMESPAN_TEXT_WITH_ENDELEMENT
=
0xaf
,
RECORD_
U
UID_TEXT
=
0xb0
,
RECORD_
U
UID_TEXT_WITH_ENDELEMENT
=
0xb1
,
RECORD_
G
UID_TEXT
=
0xb0
,
RECORD_
G
UID_TEXT_WITH_ENDELEMENT
=
0xb1
,
RECORD_UINT64_TEXT
=
0xb2
,
RECORD_UINT64_TEXT_WITH_ENDELEMENT
=
0xb3
,
RECORD_BOOL_TEXT
=
0xb4
,
...
...
dlls/webservices/writer.c
View file @
b85e6800
...
...
@@ -716,6 +716,9 @@ static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text )
if
(
text_double
->
value
<=
MAX_INT32
)
return
RECORD_INT32_TEXT
;
return
RECORD_INT64_TEXT
;
}
case
WS_XML_TEXT_TYPE_GUID
:
return
RECORD_GUID_TEXT
;
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -851,8 +854,15 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_double
->
value
,
sizeof
(
text_double
->
value
)
);
return
S_OK
;
}
case
RECORD_GUID_TEXT
:
{
WS_XML_GUID_TEXT
*
text_guid
=
(
WS_XML_GUID_TEXT
*
)
text
;
if
((
hr
=
write_grow_buffer
(
writer
,
sizeof
(
text_guid
->
value
)
))
!=
S_OK
)
return
hr
;
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_guid
->
value
,
sizeof
(
text_guid
->
value
)
);
return
S_OK
;
}
default:
ERR
(
"unhandled record type %02x
\n
"
,
type
);
FIXME
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
}
}
...
...
@@ -2481,6 +2491,9 @@ static enum record_type get_text_record_type( const WS_XML_TEXT *text )
if
(
text_double
->
value
<=
MAX_INT32
)
return
RECORD_INT32_TEXT_WITH_ENDELEMENT
;
return
RECORD_INT64_TEXT_WITH_ENDELEMENT
;
}
case
WS_XML_TEXT_TYPE_GUID
:
return
RECORD_GUID_TEXT_WITH_ENDELEMENT
;
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -2621,6 +2634,14 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_double
->
value
,
sizeof
(
text_double
->
value
)
);
return
S_OK
;
}
case
RECORD_GUID_TEXT_WITH_ENDELEMENT
:
{
WS_XML_GUID_TEXT
*
text_guid
=
(
WS_XML_GUID_TEXT
*
)
text
;
if
((
hr
=
write_grow_buffer
(
writer
,
1
+
sizeof
(
text_guid
->
value
)
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
type
);
write_bytes
(
writer
,
(
const
BYTE
*
)
&
text_guid
->
value
,
sizeof
(
text_guid
->
value
)
);
return
S_OK
;
}
default:
FIXME
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
...
...
@@ -3160,8 +3181,7 @@ static HRESULT write_type_guid( struct writer *writer, WS_TYPE_MAPPING mapping,
const
WS_GUID_DESCRIPTION
*
desc
,
WS_WRITE_OPTION
option
,
const
void
*
value
,
ULONG
size
)
{
WS_XML_UTF8_TEXT
utf8
;
unsigned
char
buf
[
37
];
/* "00000000-0000-0000-0000-000000000000" */
WS_XML_GUID_TEXT
text_guid
;
const
GUID
*
ptr
;
HRESULT
hr
;
...
...
@@ -3175,10 +3195,9 @@ static HRESULT write_type_guid( struct writer *writer, WS_TYPE_MAPPING mapping,
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
sizeof
(
GUID
),
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
if
(
option
==
WS_WRITE_NILLABLE_POINTER
&&
!
ptr
)
return
write_add_nil_attribute
(
writer
);
utf8
.
text
.
textType
=
WS_XML_TEXT_TYPE_UTF8
;
utf8
.
value
.
bytes
=
buf
;
utf8
.
value
.
length
=
format_guid
(
ptr
,
buf
);
return
write_type_text
(
writer
,
mapping
,
&
utf8
.
text
);
text_guid
.
text
.
textType
=
WS_XML_TEXT_TYPE_GUID
;
text_guid
.
value
=
*
ptr
;
return
write_type_text
(
writer
,
mapping
,
&
text_guid
.
text
);
}
static
HRESULT
write_type_unique_id
(
struct
writer
*
writer
,
WS_TYPE_MAPPING
mapping
,
...
...
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