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
91513caa
Commit
91513caa
authored
Oct 07, 2008
by
Michael Karcher
Committed by
Alexandre Julliard
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Handle all variant types in IXMLDOMDocument::createNode.
parent
27e9a983
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
6 deletions
+48
-6
domdoc.c
dlls/msxml3/domdoc.c
+16
-6
domdoc.c
dlls/msxml3/tests/domdoc.c
+32
-0
No files found.
dlls/msxml3/domdoc.c
View file @
91513caa
...
...
@@ -1110,13 +1110,19 @@ static HRESULT WINAPI domdoc_getElementsByTagName(
return
hr
;
}
static
DOMNodeType
get_node_type
(
VARIANT
T
ype
)
static
HRESULT
get_node_type
(
VARIANT
Type
,
DOMNodeType
*
t
ype
)
{
if
(
V_VT
(
&
Type
)
==
VT_I4
)
return
V_I4
(
&
Type
);
VARIANT
tmp
;
HRESULT
hr
;
VariantInit
(
&
tmp
);
hr
=
VariantChangeType
(
&
tmp
,
&
Type
,
0
,
VT_I4
);
if
(
FAILED
(
hr
))
return
E_INVALIDARG
;
*
type
=
V_I4
(
&
tmp
);
FIXME
(
"Unsupported variant type %x
\n
"
,
V_VT
(
&
Type
));
return
0
;
return
S_OK
;
}
static
HRESULT
WINAPI
domdoc_createNode
(
...
...
@@ -1130,10 +1136,14 @@ static HRESULT WINAPI domdoc_createNode(
DOMNodeType
node_type
;
xmlNodePtr
xmlnode
=
NULL
;
xmlChar
*
xml_name
;
HRESULT
hr
;
TRACE
(
"(%p)->(type,%s,%s,%p)
\n
"
,
This
,
debugstr_w
(
name
),
debugstr_w
(
namespaceURI
),
node
);
node_type
=
get_node_type
(
Type
);
hr
=
get_node_type
(
Type
,
&
node_type
);
if
(
FAILED
(
hr
))
return
hr
;
TRACE
(
"node_type %d
\n
"
,
node_type
);
xml_name
=
xmlChar_from_wchar
((
WCHAR
*
)
name
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
91513caa
...
...
@@ -1353,6 +1353,8 @@ static void test_refs(void)
static
void
test_create
(
void
)
{
static
const
WCHAR
szOne
[]
=
{
'1'
,
0
};
static
const
WCHAR
szOneGarbage
[]
=
{
'1'
,
'G'
,
'a'
,
'r'
,
'b'
,
'a'
,
'g'
,
'e'
,
0
};
HRESULT
r
;
VARIANT
var
;
BSTR
str
,
name
;
...
...
@@ -1369,6 +1371,36 @@ static void test_create(void)
if
(
r
!=
S_OK
)
return
;
V_VT
(
&
var
)
=
VT_I1
;
V_I1
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
str
,
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
)
)
IXMLDOMNode_Release
(
node
);
V_VT
(
&
var
)
=
VT_R4
;
V_R4
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
str
,
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
)
)
IXMLDOMNode_Release
(
node
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
szOne
);
str
=
SysAllocString
(
szlc
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
str
,
NULL
,
&
node
);
ok
(
r
==
S_OK
,
"returns %08x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
)
)
IXMLDOMNode_Release
(
node
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
SysAllocString
(
szOneGarbage
);
str
=
SysAllocString
(
szlc
);
r
=
IXMLDOMDocument_createNode
(
doc
,
var
,
str
,
NULL
,
&
node
);
ok
(
r
==
E_INVALIDARG
,
"returns %08x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
)
)
IXMLDOMNode_Release
(
node
);
VariantClear
(
&
var
);
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
NODE_ELEMENT
;
str
=
SysAllocString
(
szlc
);
...
...
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