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
12d2417e
Commit
12d2417e
authored
Oct 22, 2021
by
Daniel Lehman
Committed by
Alexandre Julliard
Oct 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Parse XML declaration when creating processing instruction.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3186df70
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
24 deletions
+36
-24
domdoc.c
dlls/msxml3/domdoc.c
+3
-6
msxml_private.h
dlls/msxml3/msxml_private.h
+2
-0
pi.c
dlls/msxml3/pi.c
+26
-15
domdoc.c
dlls/msxml3/tests/domdoc.c
+5
-3
No files found.
dlls/msxml3/domdoc.c
View file @
12d2417e
...
@@ -1884,13 +1884,10 @@ static HRESULT WINAPI domdoc_createProcessingInstruction(
...
@@ -1884,13 +1884,10 @@ static HRESULT WINAPI domdoc_createProcessingInstruction(
hr
=
IXMLDOMDocument3_createNode
(
iface
,
type
,
target
,
NULL
,
&
node
);
hr
=
IXMLDOMDocument3_createNode
(
iface
,
type
,
target
,
NULL
,
&
node
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
xmlnode
*
node_obj
;
/* this is to bypass check in ::put_data() that blocks "<?xml" PIs */
/* this is to bypass check in ::put_data() that blocks "<?xml" PIs */
node_obj
=
get_node_obj
(
node
);
hr
=
dom_pi_put_xml_decl
(
node
,
data
);
hr
=
node_set_content
(
node_obj
,
data
);
if
(
SUCCEEDED
(
hr
))
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMProcessingInstruction
,
(
void
**
)
pi
);
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMProcessingInstruction
,
(
void
**
)
pi
);
IXMLDOMNode_Release
(
node
);
IXMLDOMNode_Release
(
node
);
}
}
...
...
dlls/msxml3/msxml_private.h
View file @
12d2417e
...
@@ -261,6 +261,8 @@ extern BSTR EnsureCorrectEOL(BSTR) DECLSPEC_HIDDEN;
...
@@ -261,6 +261,8 @@ extern BSTR EnsureCorrectEOL(BSTR) DECLSPEC_HIDDEN;
extern
xmlChar
*
tagName_to_XPath
(
const
BSTR
tagName
)
DECLSPEC_HIDDEN
;
extern
xmlChar
*
tagName_to_XPath
(
const
BSTR
tagName
)
DECLSPEC_HIDDEN
;
extern
HRESULT
dom_pi_put_xml_decl
(
IXMLDOMNode
*
node
,
BSTR
data
)
DECLSPEC_HIDDEN
;
#include <libxslt/documents.h>
#include <libxslt/documents.h>
extern
xmlDocPtr
xslt_doc_default_loader
(
const
xmlChar
*
uri
,
xmlDictPtr
dict
,
int
options
,
extern
xmlDocPtr
xslt_doc_default_loader
(
const
xmlChar
*
uri
,
xmlDictPtr
dict
,
int
options
,
void
*
_ctxt
,
xsltLoadType
type
)
DECLSPEC_HIDDEN
;
void
*
_ctxt
,
xsltLoadType
type
)
DECLSPEC_HIDDEN
;
...
...
dlls/msxml3/pi.c
View file @
12d2417e
...
@@ -433,25 +433,11 @@ static HRESULT WINAPI dom_pi_get_attributes(
...
@@ -433,25 +433,11 @@ static HRESULT WINAPI dom_pi_get_attributes(
if
(
hr
!=
S_OK
)
return
hr
;
if
(
hr
!=
S_OK
)
return
hr
;
if
(
!
wcscmp
(
name
,
xmlW
))
if
(
!
wcscmp
(
name
,
xmlW
))
{
if
(
!
This
->
node
.
node
->
properties
)
{
hr
=
parse_xml_decl
(
This
->
node
.
node
);
if
(
hr
!=
S_OK
)
{
SysFreeString
(
name
);
return
S_FALSE
;
}
}
*
map
=
create_nodemap
(
This
->
node
.
node
,
&
dom_pi_attr_map
);
*
map
=
create_nodemap
(
This
->
node
.
node
,
&
dom_pi_attr_map
);
SysFreeString
(
name
);
return
S_OK
;
}
SysFreeString
(
name
);
SysFreeString
(
name
);
return
S_FALSE
;
return
*
map
?
S_OK
:
S_FALSE
;
}
}
static
HRESULT
WINAPI
dom_pi_insertBefore
(
static
HRESULT
WINAPI
dom_pi_insertBefore
(
...
@@ -760,6 +746,31 @@ static HRESULT WINAPI dom_pi_put_data(
...
@@ -760,6 +746,31 @@ static HRESULT WINAPI dom_pi_put_data(
return
node_set_content
(
&
This
->
node
,
data
);
return
node_set_content
(
&
This
->
node
,
data
);
}
}
HRESULT
dom_pi_put_xml_decl
(
IXMLDOMNode
*
node
,
BSTR
data
)
{
static
const
WCHAR
xmlW
[]
=
{
'x'
,
'm'
,
'l'
,
0
};
xmlnode
*
node_obj
;
HRESULT
hr
;
BSTR
name
;
node_obj
=
get_node_obj
(
node
);
hr
=
node_set_content
(
node_obj
,
data
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
node_get_nodeName
(
node_obj
,
&
name
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
lstrcmpW
(
name
,
xmlW
)
&&
!
node_obj
->
node
->
properties
)
hr
=
parse_xml_decl
(
node_obj
->
node
);
else
hr
=
S_OK
;
SysFreeString
(
name
);
return
hr
;
}
static
const
struct
IXMLDOMProcessingInstructionVtbl
dom_pi_vtbl
=
static
const
struct
IXMLDOMProcessingInstructionVtbl
dom_pi_vtbl
=
{
{
dom_pi_QueryInterface
,
dom_pi_QueryInterface
,
...
...
dlls/msxml3/tests/domdoc.c
View file @
12d2417e
...
@@ -8592,7 +8592,6 @@ static void test_createProcessingInstruction(void)
...
@@ -8592,7 +8592,6 @@ static void test_createProcessingInstruction(void)
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
windows-1252
\"
dummy=
\"
value
\"
"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
windows-1252
\"
dummy=
\"
value
\"
"
),
&
pi
);
todo_wine
ok
(
hr
==
XML_E_UNEXPECTED_ATTRIBUTE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
XML_E_UNEXPECTED_ATTRIBUTE
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
NULL
,
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
NULL
,
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
"
),
&
pi
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
...
@@ -8600,7 +8599,6 @@ todo_wine
...
@@ -8600,7 +8599,6 @@ todo_wine
todo_wine
todo_wine
ok
(
hr
==
XML_E_XMLDECLSYNTAX
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
XML_E_XMLDECLSYNTAX
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=UTF-8"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=UTF-8"
),
&
pi
);
todo_wine
ok
(
hr
==
XML_E_MISSINGQUOTE
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
XML_E_MISSINGQUOTE
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding='UTF-8
\"
"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding='UTF-8
\"
"
),
&
pi
);
todo_wine
todo_wine
...
@@ -8608,17 +8606,21 @@ todo_wine
...
@@ -8608,17 +8606,21 @@ todo_wine
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
UTF-8"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding=
\"
UTF-8"
),
&
pi
);
todo_wine
todo_wine
ok
(
hr
==
XML_E_BADCHARINSTRING
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
XML_E_BADCHARINSTRING
,
"got 0x%08x
\n
"
,
hr
);
pi
=
NULL
;
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding='UTF-8'"
),
&
pi
);
hr
=
IXMLDOMDocument_createProcessingInstruction
(
doc
,
_bstr_
(
"xml"
),
_bstr_
(
"version=
\"
1.0
\"
encoding='UTF-8'"
),
&
pi
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
pi
)
{
hr
=
IXMLDOMProcessingInstruction_QueryInterface
(
pi
,
&
IID_IXMLDOMNode
,
(
void
**
)
&
node
);
hr
=
IXMLDOMProcessingInstruction_QueryInterface
(
pi
,
&
IID_IXMLDOMNode
,
(
void
**
)
&
node
);
node_map
=
NULL
;
node_map
=
NULL
;
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMNode_get_attributes
(
node
,
&
node_map
);
hr
=
IXMLDOMNode_get_attributes
(
node
,
&
node_map
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
node_map
)
IXMLDOMNamedNodeMap_Release
(
node_map
);
if
(
node_map
)
IXMLDOMNamedNodeMap_Release
(
node_map
);
IXMLDOMNode_Release
(
node
);
IXMLDOMNode_Release
(
node
);
IXMLDOMProcessingInstruction_Release
(
pi
);
IXMLDOMProcessingInstruction_Release
(
pi
);
}
/* test for BSTR handling, pass broken BSTR */
/* test for BSTR handling, pass broken BSTR */
memcpy
(
&
buff
[
2
],
L"test"
,
5
*
sizeof
(
WCHAR
));
memcpy
(
&
buff
[
2
],
L"test"
,
5
*
sizeof
(
WCHAR
));
...
...
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