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
2a6abc24
Commit
2a6abc24
authored
Aug 27, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Use element name length passed to content handler.
parent
9ae103f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
mxwriter.c
dlls/msxml3/mxwriter.c
+8
-7
saxreader.c
dlls/msxml3/tests/saxreader.c
+23
-6
No files found.
dlls/msxml3/mxwriter.c
View file @
2a6abc24
...
...
@@ -155,16 +155,16 @@ static void close_element_starttag(const mxwriter *This)
xmlOutputBufferWriteString
(
This
->
buffer
,
">"
);
}
static
void
set_element_name
(
mxwriter
*
This
,
const
WCHAR
*
name
)
static
void
set_element_name
(
mxwriter
*
This
,
const
WCHAR
*
name
,
int
len
)
{
SysFreeString
(
This
->
element
);
This
->
element
=
SysAllocString
(
name
)
;
This
->
element
=
name
?
SysAllocStringLen
(
name
,
len
)
:
NULL
;
}
static
inline
HRESULT
flush_output_buffer
(
mxwriter
*
This
)
{
close_element_starttag
(
This
);
set_element_name
(
This
,
NULL
);
set_element_name
(
This
,
NULL
,
0
);
xmlOutputBufferFlush
(
This
->
buffer
);
return
write_data_to_stream
(
This
);
}
...
...
@@ -763,10 +763,11 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement(
return
E_INVALIDARG
;
close_element_starttag
(
This
);
set_element_name
(
This
,
QName
?
QName
:
emptyW
);
set_element_name
(
This
,
QName
?
QName
:
emptyW
,
QName
?
nQName
:
0
);
xmlOutputBufferWriteString
(
This
->
buffer
,
"<"
);
s
=
xmlchar_from_wchar
(
QName
);
s
=
xmlchar_from_wchar
n
(
QName
,
n
QName
);
xmlOutputBufferWriteString
(
This
->
buffer
,
(
char
*
)
s
);
heap_free
(
s
);
...
...
@@ -843,7 +844,7 @@ static HRESULT WINAPI mxwriter_saxcontent_endElement(
}
heap_free
(
s
);
set_element_name
(
This
,
NULL
);
set_element_name
(
This
,
NULL
,
0
);
return
S_OK
;
}
...
...
@@ -860,7 +861,7 @@ static HRESULT WINAPI mxwriter_saxcontent_characters(
if
(
!
chars
)
return
E_INVALIDARG
;
close_element_starttag
(
This
);
set_element_name
(
This
,
NULL
);
set_element_name
(
This
,
NULL
,
0
);
if
(
nchars
)
{
...
...
dlls/msxml3/tests/saxreader.c
View file @
2a6abc24
...
...
@@ -1720,27 +1720,44 @@ static void test_mxwriter_startendelement(void)
VariantClear
(
&
dest
);
hr
=
ISAXContentHandler_endElement
(
content
,
NULL
,
0
,
NULL
,
0
,
_bstr_
(
"a:b"
),
3
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXContentHandler_endElement
(
content
,
NULL
,
0
,
_bstr_
(
"b"
),
1
,
_bstr_
(
"a:b"
),
3
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
/* only local name is an error too */
hr
=
ISAXContentHandler_endElement
(
content
,
NULL
,
0
,
_bstr_
(
"b"
),
1
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXContentHandler_endElement
(
content
,
_bstr_
(
""
),
0
,
_bstr_
(
""
),
0
,
_bstr_
(
"b"
),
1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"<><b></b>"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
hr
=
ISAXContentHandler_endDocument
(
content
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXContentHandler_startDocument
(
content
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXContentHandler_startElement
(
content
,
_bstr_
(
""
),
0
,
_bstr_
(
""
),
0
,
_bstr_
(
"abcdef"
),
3
,
NULL
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
V_VT
(
&
dest
)
==
VT_BSTR
,
"got %d
\n
"
,
V_VT
(
&
dest
));
ok
(
!
lstrcmpW
(
_bstr_
(
"<abc>"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
ISAXContentHandler_Release
(
content
);
IMXWriter_Release
(
writer
);
...
...
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