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
c1464f8a
Commit
c1464f8a
authored
Feb 13, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix return value for IXMLDOMNode_put_nodeValue() for unsupported types.
parent
5262c570
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
17 deletions
+86
-17
node.c
dlls/msxml3/node.c
+18
-17
domdoc.c
dlls/msxml3/tests/domdoc.c
+68
-0
No files found.
dlls/msxml3/node.c
View file @
c1464f8a
...
...
@@ -327,23 +327,11 @@ static HRESULT WINAPI xmlnode_put_nodeValue(
{
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
HRESULT
hr
;
xmlChar
*
str
=
NULL
;
VARIANT
string_value
;
TRACE
(
"%p type(%d)
\n
"
,
This
,
This
->
node
->
type
);
VariantInit
(
&
string_value
);
hr
=
VariantChangeType
(
&
string_value
,
&
value
,
0
,
VT_BSTR
);
if
(
FAILED
(
hr
))
{
VariantClear
(
&
string_value
);
WARN
(
"Couldn't convert to VT_BSTR
\n
"
);
return
hr
;
}
hr
=
S_FALSE
;
/* Document, Document Fragment, Document Type, Element,
Entity, Entity Reference, Notation aren't supported. */
Entity, Entity Reference, Notation aren't supported. */
switch
(
This
->
node
->
type
)
{
case
XML_ATTRIBUTE_NODE
:
...
...
@@ -351,20 +339,33 @@ static HRESULT WINAPI xmlnode_put_nodeValue(
case
XML_COMMENT_NODE
:
case
XML_PI_NODE
:
case
XML_TEXT_NODE
:
{
{
VARIANT
string_value
;
xmlChar
*
str
;
VariantInit
(
&
string_value
);
hr
=
VariantChangeType
(
&
string_value
,
&
value
,
0
,
VT_BSTR
);
if
(
FAILED
(
hr
))
{
VariantClear
(
&
string_value
);
WARN
(
"Couldn't convert to VT_BSTR
\n
"
);
return
hr
;
}
str
=
xmlChar_from_wchar
(
V_BSTR
(
&
string_value
));
VariantClear
(
&
string_value
);
xmlNodeSetContent
(
This
->
node
,
str
);
heap_free
(
str
);
hr
=
S_OK
;
break
;
}
}
default:
/* Do nothing for unsupported types. */
hr
=
E_FAIL
;
break
;
}
VariantClear
(
&
string_value
);
return
hr
;
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
c1464f8a
...
...
@@ -5000,6 +5000,73 @@ static void test_TransformWithLoadingLocalFile(void)
free_bstrs
();
}
static
void
test_put_nodeValue
(
void
)
{
IXMLDOMDocument
*
doc
;
IXMLDOMEntityReference
*
entityref
;
IXMLDOMNode
*
node
;
HRESULT
hr
;
VARIANT
data
,
type
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
if
(
hr
!=
S_OK
)
return
;
/* test for unsupported types */
/* NODE_DOCUMENT */
hr
=
IXMLDOMDocument_QueryInterface
(
doc
,
&
IID_IXMLDOMNode
,
(
void
**
)
&
node
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
V_VT
(
&
data
)
=
VT_BSTR
;
V_BSTR
(
&
data
)
=
_bstr_
(
"one two three"
);
hr
=
IXMLDOMNode_put_nodeValue
(
node
,
data
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
/* NODE_DOCUMENT_FRAGMENT */
V_VT
(
&
type
)
=
VT_I1
;
V_I1
(
&
type
)
=
NODE_DOCUMENT_FRAGMENT
;
hr
=
IXMLDOMDocument_createNode
(
doc
,
type
,
_bstr_
(
"test"
),
NULL
,
&
node
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
V_VT
(
&
data
)
=
VT_BSTR
;
V_BSTR
(
&
data
)
=
_bstr_
(
"one two three"
);
hr
=
IXMLDOMNode_put_nodeValue
(
node
,
data
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
/* NODE_ELEMENT */
V_VT
(
&
type
)
=
VT_I1
;
V_I1
(
&
type
)
=
NODE_ELEMENT
;
hr
=
IXMLDOMDocument_createNode
(
doc
,
type
,
_bstr_
(
"test"
),
NULL
,
&
node
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
V_VT
(
&
data
)
=
VT_BSTR
;
V_BSTR
(
&
data
)
=
_bstr_
(
"one two three"
);
hr
=
IXMLDOMNode_put_nodeValue
(
node
,
data
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
/* NODE_ENTITY_REFERENCE */
hr
=
IXMLDOMDocument_createEntityReference
(
doc
,
_bstr_
(
"ref"
),
&
entityref
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
V_VT
(
&
data
)
=
VT_BSTR
;
V_BSTR
(
&
data
)
=
_bstr_
(
"one two three"
);
hr
=
IXMLDOMEntityReference_put_nodeValue
(
node
,
data
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMEntityReference_QueryInterface
(
entityref
,
&
IID_IXMLDOMNode
,
(
void
**
)
&
node
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
V_VT
(
&
data
)
=
VT_BSTR
;
V_BSTR
(
&
data
)
=
_bstr_
(
"one two three"
);
hr
=
IXMLDOMNode_put_nodeValue
(
node
,
data
);
ok
(
hr
==
E_FAIL
,
"ret %08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
IXMLDOMEntityReference_Release
(
entityref
);
free_bstrs
();
IXMLDOMDocument_Release
(
doc
);
}
START_TEST
(
domdoc
)
{
HRESULT
r
;
...
...
@@ -5030,6 +5097,7 @@ START_TEST(domdoc)
test_FormattingXML
();
test_NodeTypeValue
();
test_TransformWithLoadingLocalFile
();
test_put_nodeValue
();
CoUninitialize
();
}
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