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
11028500
Commit
11028500
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 byte records in the writer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7018ccd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
writer.c
dlls/webservices/writer.c
+74
-0
No files found.
dlls/webservices/writer.c
View file @
11028500
...
...
@@ -661,6 +661,13 @@ static enum record_type get_attr_text_record_type( const WS_XML_TEXT *text )
if
(
text_utf8
->
value
.
length
<=
MAX_UINT16
)
return
RECORD_CHARS16_TEXT
;
return
RECORD_CHARS32_TEXT
;
}
case
WS_XML_TEXT_TYPE_BASE64
:
{
const
WS_XML_BASE64_TEXT
*
text_base64
=
(
const
WS_XML_BASE64_TEXT
*
)
text
;
if
(
text_base64
->
length
<=
MAX_UINT8
)
return
RECORD_BYTES8_TEXT
;
if
(
text_base64
->
length
<=
MAX_UINT16
)
return
RECORD_BYTES16_TEXT
;
return
RECORD_BYTES32_TEXT
;
}
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -700,6 +707,23 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
write_bytes
(
writer
,
text_utf8
->
value
.
bytes
,
len
);
return
S_OK
;
}
case
RECORD_BYTES8_TEXT
:
{
WS_XML_BASE64_TEXT
*
text_base64
=
(
WS_XML_BASE64_TEXT
*
)
text
;
if
((
hr
=
write_grow_buffer
(
writer
,
1
+
text_base64
->
length
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
text_base64
->
length
);
write_bytes
(
writer
,
text_base64
->
bytes
,
text_base64
->
length
);
return
S_OK
;
}
case
RECORD_BYTES16_TEXT
:
{
WS_XML_BASE64_TEXT
*
text_base64
=
(
WS_XML_BASE64_TEXT
*
)
text
;
UINT16
len
=
text_base64
->
length
;
if
((
hr
=
write_grow_buffer
(
writer
,
sizeof
(
len
)
+
len
))
!=
S_OK
)
return
hr
;
write_bytes
(
writer
,
(
const
BYTE
*
)
&
len
,
sizeof
(
len
)
);
write_bytes
(
writer
,
text_base64
->
bytes
,
len
);
return
S_OK
;
}
default:
ERR
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
...
...
@@ -2300,6 +2324,14 @@ static enum record_type get_text_record_type( const WS_XML_TEXT *text )
if
(
text_utf8
->
value
.
length
<=
MAX_UINT16
)
return
RECORD_CHARS16_TEXT_WITH_ENDELEMENT
;
return
RECORD_CHARS32_TEXT_WITH_ENDELEMENT
;
}
case
WS_XML_TEXT_TYPE_BASE64
:
{
const
WS_XML_BASE64_TEXT
*
text_base64
=
(
const
WS_XML_BASE64_TEXT
*
)
text
;
ULONG
rem
=
text_base64
->
length
%
3
,
len
=
text_base64
->
length
-
rem
;
if
(
len
<=
MAX_UINT8
)
return
RECORD_BYTES8_TEXT
;
if
(
len
<=
MAX_UINT16
)
return
RECORD_BYTES16_TEXT
;
return
RECORD_BYTES32_TEXT
;
}
default:
FIXME
(
"unhandled text type %u
\n
"
,
text
->
textType
);
return
0
;
...
...
@@ -2341,6 +2373,48 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
write_bytes
(
writer
,
text_utf8
->
value
.
bytes
,
len
);
return
S_OK
;
}
case
RECORD_BYTES8_TEXT
:
{
const
WS_XML_BASE64_TEXT
*
text_base64
=
(
const
WS_XML_BASE64_TEXT
*
)
text
;
UINT8
rem
=
text_base64
->
length
%
3
,
len
=
text_base64
->
length
-
rem
;
if
(
len
)
{
if
((
hr
=
write_grow_buffer
(
writer
,
1
+
sizeof
(
len
)
+
len
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
rem
?
RECORD_BYTES8_TEXT
:
RECORD_BYTES8_TEXT_WITH_ENDELEMENT
);
write_char
(
writer
,
len
);
write_bytes
(
writer
,
text_base64
->
bytes
,
len
);
}
if
(
rem
)
{
if
((
hr
=
write_grow_buffer
(
writer
,
3
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
RECORD_BYTES8_TEXT_WITH_ENDELEMENT
);
write_char
(
writer
,
rem
);
write_bytes
(
writer
,
(
const
BYTE
*
)
text_base64
->
bytes
+
len
,
rem
);
}
return
S_OK
;
}
case
RECORD_BYTES16_TEXT
:
{
const
WS_XML_BASE64_TEXT
*
text_base64
=
(
const
WS_XML_BASE64_TEXT
*
)
text
;
UINT16
rem
=
text_base64
->
length
%
3
,
len
=
text_base64
->
length
-
rem
;
if
(
len
)
{
if
((
hr
=
write_grow_buffer
(
writer
,
1
+
sizeof
(
len
)
+
len
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
rem
?
RECORD_BYTES16_TEXT
:
RECORD_BYTES16_TEXT_WITH_ENDELEMENT
);
write_bytes
(
writer
,
(
const
BYTE
*
)
&
len
,
sizeof
(
len
)
);
write_bytes
(
writer
,
text_base64
->
bytes
,
len
);
}
if
(
rem
)
{
if
((
hr
=
write_grow_buffer
(
writer
,
3
))
!=
S_OK
)
return
hr
;
write_char
(
writer
,
RECORD_BYTES8_TEXT_WITH_ENDELEMENT
);
write_char
(
writer
,
rem
);
write_bytes
(
writer
,
(
const
BYTE
*
)
text_base64
->
bytes
+
len
,
rem
);
}
return
S_OK
;
}
default:
FIXME
(
"unhandled record type %02x
\n
"
,
type
);
return
E_NOTIMPL
;
...
...
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