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
87002537
Commit
87002537
authored
Nov 19, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implemented xmlnode_get_nodeTypedValue 'bin.base64' data type handling.
parent
3c58b1c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
node.c
dlls/msxml3/node.c
+40
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+18
-0
No files found.
dlls/msxml3/node.c
View file @
87002537
...
...
@@ -953,6 +953,15 @@ inline BYTE hex_to_byte(xmlChar c)
return
c
-
'a'
+
10
;
}
inline
BYTE
base64_to_byte
(
xmlChar
c
)
{
if
(
c
==
'+'
)
return
62
;
if
(
c
==
'/'
)
return
63
;
if
(
c
<=
'9'
)
return
c
-
'0'
+
52
;
if
(
c
<=
'Z'
)
return
c
-
'A'
;
return
c
-
'a'
+
26
;
}
inline
HRESULT
VARIANT_from_xmlChar
(
xmlChar
*
str
,
VARIANT
*
v
,
BSTR
type
)
{
if
(
!
type
||
!
lstrcmpiW
(
type
,
szString
)
||
...
...
@@ -1041,6 +1050,37 @@ inline HRESULT VARIANT_from_xmlChar(xmlChar *str, VARIANT *v, BSTR type)
((
BYTE
*
)
V_ARRAY
(
v
)
->
pvData
)[
i
]
=
(
hex_to_byte
(
str
[
2
*
i
])
<<
4
)
+
hex_to_byte
(
str
[
2
*
i
+
1
]);
}
else
if
(
!
lstrcmpiW
(
type
,
szBinBase64
))
{
SAFEARRAYBOUND
sab
;
int
i
,
len
;
len
=
xmlStrlen
(
str
);
if
(
str
[
len
-
2
]
==
'='
)
i
=
2
;
else
if
(
str
[
len
-
1
]
==
'='
)
i
=
1
;
else
i
=
0
;
sab
.
lLbound
=
0
;
sab
.
cElements
=
len
/
4
*
3
-
i
;
V_VT
(
v
)
=
(
VT_ARRAY
|
VT_UI1
);
V_ARRAY
(
v
)
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
sab
);
if
(
!
V_ARRAY
(
v
))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
len
/
4
;
i
++
)
{
((
BYTE
*
)
V_ARRAY
(
v
)
->
pvData
)[
3
*
i
]
=
(
base64_to_byte
(
str
[
4
*
i
])
<<
2
)
+
(
base64_to_byte
(
str
[
4
*
i
+
1
])
>>
4
);
if
(
3
*
i
+
1
<
sab
.
cElements
)
((
BYTE
*
)
V_ARRAY
(
v
)
->
pvData
)[
3
*
i
+
1
]
=
(
base64_to_byte
(
str
[
4
*
i
+
1
])
<<
4
)
+
(
base64_to_byte
(
str
[
4
*
i
+
2
])
>>
2
);
if
(
3
*
i
+
2
<
sab
.
cElements
)
((
BYTE
*
)
V_ARRAY
(
v
)
->
pvData
)[
3
*
i
+
2
]
=
(
base64_to_byte
(
str
[
4
*
i
+
2
])
<<
6
)
+
base64_to_byte
(
str
[
4
*
i
+
3
]);
}
}
else
{
VARIANT
src
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
87002537
...
...
@@ -172,6 +172,7 @@ static const CHAR szTypeValueXML[] =
" <float dt:dt=
\"
float
\"
>41221.421</float>
\n
"
" <uuid dt:dt=
\"
uuid
\"
>333C7BC4-460F-11D0-BC04-0080C7055a83</uuid>
\n
"
" <binhex dt:dt=
\"
bin.hex
\"
>fffca012003c</binhex>
\n
"
" <binbase64 dt:dt=
\"
bin.base64
\"
>YmFzZTY0IHRlc3Q=</binbase64>
\n
"
"</root>"
;
static
const
CHAR
szBasicTransformSSXMLPart1
[]
=
...
...
@@ -4308,6 +4309,23 @@ static void test_NodeTypeValue(void)
IXMLDOMNode_Release
(
pNode
);
}
hr
=
IXMLDOMDocument2_selectSingleNode
(
doc
,
_bstr_
(
"root/binbase64"
),
&
pNode
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
BYTE
bytes
[]
=
{
0x62
,
0x61
,
0x73
,
0x65
,
0x36
,
0x34
,
0x20
,
0x74
,
0x65
,
0x73
,
0x74
};
hr
=
IXMLDOMNode_get_nodeTypedValue
(
pNode
,
&
v
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
(
VT_ARRAY
|
VT_UI1
),
"incorrect type
\n
"
);
ok
(
V_ARRAY
(
&
v
)
->
rgsabound
[
0
].
cElements
==
11
,
"incorrect array size
\n
"
);
if
(
V_ARRAY
(
&
v
)
->
rgsabound
[
0
].
cElements
==
11
)
ok
(
!
memcmp
(
bytes
,
V_ARRAY
(
&
v
)
->
pvData
,
sizeof
(
bytes
)),
"incorrect value
\n
"
);
VariantClear
(
&
v
);
IXMLDOMNode_Release
(
pNode
);
}
}
IXMLDOMDocument2_Release
(
doc
);
...
...
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