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
c9563be5
Commit
c9563be5
authored
Mar 01, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Escape value for attribute in put_value().
parent
a935a44b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
attribute.c
dlls/msxml3/attribute.c
+1
-1
domdoc.c
dlls/msxml3/tests/domdoc.c
+50
-0
No files found.
dlls/msxml3/attribute.c
View file @
c9563be5
...
...
@@ -603,7 +603,7 @@ static HRESULT WINAPI domattr_put_value(
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
value
));
return
node_put_value
(
&
This
->
node
,
&
value
);
return
node_put_value
_escaped
(
&
This
->
node
,
&
value
);
}
static
const
struct
IXMLDOMAttributeVtbl
domattr_vtbl
=
...
...
dlls/msxml3/tests/domdoc.c
View file @
c9563be5
...
...
@@ -8046,10 +8046,15 @@ static void test_put_nodeTypedValue(void)
static
void
test_get_xml
(
void
)
{
static
const
char
xmlA
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-16
\"
?>
\r\n
<a>test</a>
\r\n
"
;
static
const
char
attrA
[]
=
"attr=
\"
"a & b"
\"
"
;
static
const
char
attr2A
[]
=
"
\"
a & b
\"
"
;
static
const
char
attr3A
[]
=
"attr=
\"
&quot;a
\"
"
;
static
const
char
attr4A
[]
=
""a"
;
static
const
char
fooA
[]
=
"<foo/>"
;
IXMLDOMProcessingInstruction
*
pi
;
IXMLDOMNode
*
first
;
IXMLDOMElement
*
elem
=
NULL
;
IXMLDOMAttribute
*
attr
;
IXMLDOMDocument
*
doc
;
VARIANT_BOOL
b
;
VARIANT
v
;
...
...
@@ -8105,6 +8110,51 @@ static void test_get_xml(void)
SysFreeString
(
xml
);
IXMLDOMElement_Release
(
elem
);
/* attribute node */
hr
=
IXMLDOMDocument_createAttribute
(
doc
,
_bstr_
(
"attr"
),
&
attr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
_bstr_
(
"
\"
a & b
\"
"
);
hr
=
IXMLDOMAttribute_put_value
(
attr
,
v
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
xml
=
NULL
;
hr
=
IXMLDOMAttribute_get_xml
(
attr
,
&
xml
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
memcmp
(
xml
,
_bstr_
(
attrA
),
(
sizeof
(
attrA
)
-
1
)
*
sizeof
(
WCHAR
)),
"got %s
\n
"
,
wine_dbgstr_w
(
xml
));
SysFreeString
(
xml
);
VariantInit
(
&
v
);
hr
=
IXMLDOMAttribute_get_value
(
attr
,
&
v
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"got type %d
\n
"
,
V_VT
(
&
v
));
ok
(
!
memcmp
(
V_BSTR
(
&
v
),
_bstr_
(
attr2A
),
(
sizeof
(
attr2A
)
-
1
)
*
sizeof
(
WCHAR
)),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
_bstr_
(
""a"
);
hr
=
IXMLDOMAttribute_put_value
(
attr
,
v
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
xml
=
NULL
;
hr
=
IXMLDOMAttribute_get_xml
(
attr
,
&
xml
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
memcmp
(
xml
,
_bstr_
(
attr3A
),
(
sizeof
(
attr3A
)
-
1
)
*
sizeof
(
WCHAR
)),
"got %s
\n
"
,
wine_dbgstr_w
(
xml
));
SysFreeString
(
xml
);
VariantInit
(
&
v
);
hr
=
IXMLDOMAttribute_get_value
(
attr
,
&
v
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"got type %d
\n
"
,
V_VT
(
&
v
));
ok
(
!
memcmp
(
V_BSTR
(
&
v
),
_bstr_
(
attr4A
),
(
sizeof
(
attr4A
)
-
1
)
*
sizeof
(
WCHAR
)),
"got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
IXMLDOMAttribute_Release
(
attr
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
...
...
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