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
57ee10ff
Commit
57ee10ff
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: Revert "Simplify IXMLDOMNode::removeChild".
The simplification was bad, native msxml works if interface pointers to the wrong interface are passed in. Tests included.
parent
91513caa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
node.c
dlls/msxml3/node.c
+10
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+6
-2
No files found.
dlls/msxml3/node.c
View file @
57ee10ff
...
...
@@ -671,6 +671,8 @@ static HRESULT WINAPI xmlnode_removeChild(
{
xmlnode
*
This
=
impl_from_IXMLDOMNode
(
iface
);
xmlNode
*
child_node_ptr
;
HRESULT
hr
;
IXMLDOMNode
*
child
;
TRACE
(
"%p->(%p, %p)
\n
"
,
This
,
childNode
,
oldChild
);
...
...
@@ -679,15 +681,22 @@ static HRESULT WINAPI xmlnode_removeChild(
if
(
oldChild
)
*
oldChild
=
NULL
;
child_node_ptr
=
impl_from_IXMLDOMNode
(
childNode
)
->
node
;
hr
=
IXMLDOMNode_QueryInterface
(
childNode
,
&
IID_IXMLDOMNode
,
(
LPVOID
)
&
child
);
if
(
FAILED
(
hr
))
return
hr
;
child_node_ptr
=
impl_from_IXMLDOMNode
(
child
)
->
node
;
if
(
child_node_ptr
->
parent
!=
This
->
node
)
{
WARN
(
"childNode %p is not a child of %p
\n
"
,
childNode
,
iface
);
IXMLDOMNode_Release
(
child
);
return
E_INVALIDARG
;
}
xmlUnlinkNode
(
child_node_ptr
);
IXMLDOMNode_Release
(
child
);
if
(
oldChild
)
{
IXMLDOMNode_AddRef
(
childNode
);
...
...
dlls/msxml3/tests/domdoc.c
View file @
57ee10ff
...
...
@@ -1791,7 +1791,7 @@ static void test_removeChild(void)
BSTR
str
;
VARIANT_BOOL
b
;
IXMLDOMDocument
*
doc
;
IXMLDOMElement
*
element
;
IXMLDOMElement
*
element
,
*
lc_element
;
IXMLDOMNode
*
fo_node
,
*
ba_node
,
*
removed_node
,
*
temp_node
,
*
lc_node
;
IXMLDOMNodeList
*
root_list
,
*
fo_list
;
...
...
@@ -1855,7 +1855,11 @@ static void test_removeChild(void)
r
=
IXMLDOMNodeList_get_item
(
root_list
,
0
,
&
lc_node
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMElement_removeChild
(
element
,
lc_node
,
NULL
);
r
=
IXMLDOMElement_QueryInterface
(
lc_node
,
&
IID_IXMLDOMElement
,
(
LPVOID
*
)
&
lc_element
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
/* MS quirk: passing wrong interface pointer works, too */
r
=
IXMLDOMElement_removeChild
(
element
,
(
IXMLDOMNode
*
)
lc_element
,
NULL
);
ok
(
r
==
S_OK
,
"ret %08x
\n
"
,
r
);
r
=
IXMLDOMNode_get_parentNode
(
lc_node
,
&
temp_node
);
...
...
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