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
c06f2d4f
Commit
c06f2d4f
authored
Aug 17, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Add support for writing GUID values.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5ab0ceca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
7 deletions
+47
-7
writer.c
dlls/webservices/tests/writer.c
+16
-0
writer.c
dlls/webservices/writer.c
+31
-7
No files found.
dlls/webservices/tests/writer.c
View file @
c06f2d4f
...
...
@@ -580,6 +580,7 @@ static void test_basic_type(void)
HRESULT
hr
;
WS_XML_WRITER
*
writer
;
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"t"
},
ns
=
{
0
,
NULL
};
GUID
guid
;
ULONG
i
;
static
const
struct
{
...
...
@@ -671,6 +672,21 @@ static void test_basic_type(void)
check_output
(
writer
,
tests
[
i
].
result2
,
__LINE__
);
}
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
);
memset
(
&
guid
,
0
,
sizeof
(
guid
)
);
hr
=
WsWriteType
(
writer
,
WS_ELEMENT_TYPE_MAPPING
,
WS_GUID_TYPE
,
NULL
,
WS_WRITE_REQUIRED_VALUE
,
&
guid
,
sizeof
(
guid
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteEndElement
(
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
"<t>00000000-0000-0000-0000-000000000000</t>"
,
__LINE__
);
WsFreeWriter
(
writer
);
}
...
...
dlls/webservices/writer.c
View file @
c06f2d4f
...
...
@@ -1497,6 +1497,23 @@ static HRESULT write_type_uint64( struct writer *writer, WS_TYPE_MAPPING mapping
return
write_type_text
(
writer
,
mapping
,
&
utf8
.
text
);
}
static
HRESULT
write_type_guid
(
struct
writer
*
writer
,
WS_TYPE_MAPPING
mapping
,
const
WS_GUID_DESCRIPTION
*
desc
,
const
GUID
*
value
)
{
WS_XML_UTF8_TEXT
utf8
;
unsigned
char
buf
[
37
];
/* "00000000-0000-0000-0000-000000000000" */
if
(
desc
)
{
FIXME
(
"description not supported
\n
"
);
return
E_NOTIMPL
;
}
utf8
.
text
.
textType
=
WS_XML_TEXT_TYPE_UTF8
;
utf8
.
value
.
bytes
=
buf
;
utf8
.
value
.
length
=
format_guid
(
value
,
buf
);
return
write_type_text
(
writer
,
mapping
,
&
utf8
.
text
);
}
static
HRESULT
write_type_wsz
(
struct
writer
*
writer
,
WS_TYPE_MAPPING
mapping
,
const
WS_WSZ_DESCRIPTION
*
desc
,
const
WCHAR
*
value
)
{
...
...
@@ -1664,14 +1681,14 @@ static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TY
}
case
WS_INT8_TYPE
:
{
const
INT8
*
ptr
=
value
;
const
INT8
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_int8
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_INT16_TYPE
:
{
const
INT16
*
ptr
=
value
;
const
INT16
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_int16
(
writer
,
mapping
,
desc
,
ptr
);
...
...
@@ -1685,39 +1702,46 @@ static HRESULT write_type( struct writer *writer, WS_TYPE_MAPPING mapping, WS_TY
}
case
WS_INT64_TYPE
:
{
const
INT64
*
ptr
=
value
;
const
INT64
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_int64
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_UINT8_TYPE
:
{
const
UINT8
*
ptr
=
value
;
const
UINT8
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_uint8
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_UINT16_TYPE
:
{
const
UINT16
*
ptr
=
value
;
const
UINT16
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_uint16
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_UINT32_TYPE
:
{
const
UINT32
*
ptr
=
value
;
const
UINT32
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_uint32
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_UINT64_TYPE
:
{
const
UINT64
*
ptr
=
value
;
const
UINT64
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_uint64
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_GUID_TYPE
:
{
const
GUID
*
ptr
;
if
(
!
option
)
option
=
WS_WRITE_REQUIRED_VALUE
;
if
((
hr
=
get_value_ptr
(
option
,
value
,
size
,
(
const
void
**
)
&
ptr
))
!=
S_OK
)
return
hr
;
return
write_type_guid
(
writer
,
mapping
,
desc
,
ptr
);
}
case
WS_WSZ_TYPE
:
{
const
WCHAR
*
ptr
;
...
...
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