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
de925053
Commit
de925053
authored
Feb 24, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fail to insert a node of unsupported type to a document.
parent
6c054600
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
4 deletions
+58
-4
domdoc.c
dlls/msxml3/domdoc.c
+16
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+42
-2
No files found.
dlls/msxml3/domdoc.c
View file @
de925053
...
...
@@ -1115,12 +1115,26 @@ static HRESULT WINAPI domdoc_insertBefore(
IXMLDOMNode
**
outNewChild
)
{
domdoc
*
This
=
impl_from_IXMLDOMDocument3
(
iface
);
DOMNodeType
type
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p %s %p)
\n
"
,
This
,
newChild
,
debugstr_variant
(
&
refChild
),
outNewChild
);
return
node_insert_before
(
&
This
->
node
,
newChild
,
&
refChild
,
outNewChild
);
}
hr
=
IXMLDOMNode_get_nodeType
(
newChild
,
&
type
);
if
(
hr
!=
S_OK
)
return
hr
;
TRACE
(
"new node type %d
\n
"
,
type
);
switch
(
type
)
{
case
NODE_ATTRIBUTE
:
case
NODE_DOCUMENT
:
case
NODE_CDATA_SECTION
:
if
(
outNewChild
)
*
outNewChild
=
NULL
;
return
E_FAIL
;
default:
return
node_insert_before
(
&
This
->
node
,
newChild
,
&
refChild
,
outNewChild
);
}
}
static
HRESULT
WINAPI
domdoc_replaceChild
(
IXMLDOMDocument3
*
iface
,
...
...
dlls/msxml3/tests/domdoc.c
View file @
de925053
...
...
@@ -8270,15 +8270,30 @@ todo_wine {
static
void
test_insertBefore
(
void
)
{
IXMLDOMDocument
*
doc
,
*
doc2
;
IXMLDOMDocument
*
doc
,
*
doc2
,
*
doc3
;
IXMLDOMAttribute
*
attr
;
IXMLDOMElement
*
elem1
,
*
elem2
,
*
elem3
,
*
elem4
,
*
elem5
;
IXMLDOMNode
*
node
,
*
newnode
;
IXMLDOMNode
*
node
,
*
newnode
,
*
cdata
;
HRESULT
hr
;
VARIANT
v
;
BSTR
p
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
doc3
=
create_document
(
&
IID_IXMLDOMDocument
);
/* document to document */
V_VT
(
&
v
)
=
VT_NULL
;
node
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_insertBefore
(
doc
,
(
IXMLDOMNode
*
)
doc3
,
v
,
&
node
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
node
==
NULL
,
"got %p
\n
"
,
node
);
/* document to itself */
V_VT
(
&
v
)
=
VT_NULL
;
node
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_insertBefore
(
doc
,
(
IXMLDOMNode
*
)
doc
,
v
,
&
node
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
node
==
NULL
,
"got %p
\n
"
,
node
);
/* insertBefore behaviour for attribute node */
V_VT
(
&
v
)
=
VT_I4
;
...
...
@@ -8289,6 +8304,31 @@ static void test_insertBefore(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
attr
!=
NULL
,
"got %p
\n
"
,
attr
);
/* attribute to document */
V_VT
(
&
v
)
=
VT_NULL
;
node
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_insertBefore
(
doc3
,
(
IXMLDOMNode
*
)
attr
,
v
,
&
node
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
node
==
NULL
,
"got %p
\n
"
,
node
);
/* cdata to document */
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
NODE_CDATA_SECTION
;
cdata
=
NULL
;
hr
=
IXMLDOMDocument_createNode
(
doc3
,
v
,
_bstr_
(
"cdata"
),
NULL
,
&
cdata
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cdata
!=
NULL
,
"got %p
\n
"
,
cdata
);
V_VT
(
&
v
)
=
VT_NULL
;
node
=
(
void
*
)
0xdeadbeef
;
hr
=
IXMLDOMDocument_insertBefore
(
doc3
,
cdata
,
v
,
&
node
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
node
==
NULL
,
"got %p
\n
"
,
node
);
IXMLDOMNode_Release
(
cdata
);
IXMLDOMDocument_Release
(
doc3
);
/* attribute to attribute */
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
NODE_ATTRIBUTE
;
...
...
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