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
5e08765f
Commit
5e08765f
authored
Jun 23, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Properly handle -1 as length of element qualified name in startElement().
parent
6ab3f1ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
6 deletions
+45
-6
mxwriter.c
dlls/msxml3/mxwriter.c
+4
-1
saxreader.c
dlls/msxml3/tests/saxreader.c
+41
-5
No files found.
dlls/msxml3/mxwriter.c
View file @
5e08765f
...
...
@@ -536,7 +536,10 @@ static void close_element_starttag(const mxwriter *This)
static
void
set_element_name
(
mxwriter
*
This
,
const
WCHAR
*
name
,
int
len
)
{
SysFreeString
(
This
->
element
);
This
->
element
=
name
?
SysAllocStringLen
(
name
,
len
)
:
NULL
;
if
(
name
)
This
->
element
=
len
!=
-
1
?
SysAllocStringLen
(
name
,
len
)
:
SysAllocString
(
name
);
else
This
->
element
=
NULL
;
}
static
inline
HRESULT
flush_output_buffer
(
mxwriter
*
This
)
...
...
dlls/msxml3/tests/saxreader.c
View file @
5e08765f
...
...
@@ -2822,6 +2822,7 @@ static void test_mxwriter_flush(void)
HRESULT
hr
;
char
*
buff
;
LONG
ref
;
int
len
;
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
...
...
@@ -2919,9 +2920,10 @@ static void test_mxwriter_flush(void)
EXPECT_HR
(
hr
,
S_OK
);
ok
(
pos2
.
QuadPart
==
0
,
"expected stream beginning
\n
"
);
buff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
2048
);
memset
(
buff
,
'A'
,
2048
);
hr
=
ISAXContentHandler_characters
(
content
,
_bstr_
(
buff
),
2048
);
len
=
2048
;
buff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
memset
(
buff
,
'A'
,
len
);
hr
=
ISAXContentHandler_characters
(
content
,
_bstr_
(
buff
),
len
);
EXPECT_HR
(
hr
,
S_OK
);
pos
.
QuadPart
=
0
;
...
...
@@ -2965,8 +2967,8 @@ todo_wine
EXPECT_HR
(
hr
,
S_OK
);
ok
(
pos2
.
QuadPart
==
0
,
"expected stream beginning
\n
"
);
memset
(
buff
,
'A'
,
2048
);
hr
=
ISAXContentHandler_characters
(
content
,
_bstr_
(
buff
),
2040
);
memset
(
buff
,
'A'
,
len
);
hr
=
ISAXContentHandler_characters
(
content
,
_bstr_
(
buff
),
len
-
8
);
EXPECT_HR
(
hr
,
S_OK
);
pos
.
QuadPart
=
0
;
...
...
@@ -2978,6 +2980,28 @@ todo_wine
hr
=
ISAXContentHandler_endDocument
(
content
);
EXPECT_HR
(
hr
,
S_OK
);
/* test auto-flush function when stream is not set */
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
,
emptyW
,
0
,
emptyW
,
0
,
_bstr_
(
"a"
),
-
1
,
NULL
);
EXPECT_HR
(
hr
,
S_OK
);
memset
(
buff
,
'A'
,
len
);
hr
=
ISAXContentHandler_characters
(
content
,
_bstr_
(
buff
),
len
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_get_output
(
writer
,
&
dest
);
EXPECT_HR
(
hr
,
S_OK
);
len
+=
strlen
(
"<a>"
);
ok
(
SysStringLen
(
V_BSTR
(
&
dest
))
==
len
,
"got len=%d, expected %d
\n
"
,
SysStringLen
(
V_BSTR
(
&
dest
)),
len
);
VariantClear
(
&
dest
);
HeapFree
(
GetProcessHeap
(),
0
,
buff
);
ISAXContentHandler_Release
(
content
);
IStream_Release
(
stream
);
...
...
@@ -3382,6 +3406,18 @@ static void test_mxwriter_startendelement(void)
ok
(
!
lstrcmpW
(
_bstr_
(
"<abc></abd>"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
VariantClear
(
&
dest
);
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXContentHandler_startElement
(
content
,
_bstr_
(
""
),
0
,
_bstr_
(
""
),
0
,
_bstr_
(
"a"
),
-
1
,
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_
(
"<a>"
),
V_BSTR
(
&
dest
)),
"got wrong content %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
dest
)));
ISAXContentHandler_Release
(
content
);
IMXWriter_Release
(
writer
);
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