Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3c58b1c4
Commit
3c58b1c4
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.hex' data type handling.
parent
2a9eb6e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
node.c
dlls/msxml3/node.c
+26
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+18
-0
No files found.
dlls/msxml3/node.c
View file @
3c58b1c4
...
...
@@ -946,6 +946,13 @@ static HRESULT WINAPI xmlnode_get_definition(
static
HRESULT
WINAPI
xmlnode_get_dataType
(
IXMLDOMNode
*
,
VARIANT
*
);
inline
BYTE
hex_to_byte
(
xmlChar
c
)
{
if
(
c
<=
'9'
)
return
c
-
'0'
;
if
(
c
<=
'F'
)
return
c
-
'A'
+
10
;
return
c
-
'a'
+
10
;
}
inline
HRESULT
VARIANT_from_xmlChar
(
xmlChar
*
str
,
VARIANT
*
v
,
BSTR
type
)
{
if
(
!
type
||
!
lstrcmpiW
(
type
,
szString
)
||
...
...
@@ -1015,6 +1022,25 @@ inline HRESULT VARIANT_from_xmlChar(xmlChar *str, VARIANT *v, BSTR type)
VariantClear
(
&
src
);
}
else
if
(
!
lstrcmpiW
(
type
,
szBinHex
))
{
SAFEARRAYBOUND
sab
;
int
i
,
len
;
len
=
xmlStrlen
(
str
)
/
2
;
sab
.
lLbound
=
0
;
sab
.
cElements
=
len
;
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
;
i
++
)
((
BYTE
*
)
V_ARRAY
(
v
)
->
pvData
)[
i
]
=
(
hex_to_byte
(
str
[
2
*
i
])
<<
4
)
+
hex_to_byte
(
str
[
2
*
i
+
1
]);
}
else
{
VARIANT
src
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
3c58b1c4
...
...
@@ -171,6 +171,7 @@ static const CHAR szTypeValueXML[] =
" <r8 dt:dt=
\"
r8
\"
>0.412</r8>
\n
"
" <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
"
"</root>"
;
static
const
CHAR
szBasicTransformSSXMLPart1
[]
=
...
...
@@ -4290,6 +4291,23 @@ static void test_NodeTypeValue(void)
IXMLDOMNode_Release
(
pNode
);
}
hr
=
IXMLDOMDocument2_selectSingleNode
(
doc
,
_bstr_
(
"root/binhex"
),
&
pNode
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
BYTE
bytes
[]
=
{
0xff
,
0xfc
,
0xa0
,
0x12
,
0x00
,
0x3c
};
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
==
6
,
"incorrect array size
\n
"
);
if
(
V_ARRAY
(
&
v
)
->
rgsabound
[
0
].
cElements
==
6
)
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