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
92668f1d
Commit
92668f1d
authored
May 01, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store stream reference as destination.
parent
1d816be1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
14 deletions
+135
-14
mxwriter.c
dlls/msxml3/mxwriter.c
+39
-2
saxreader.c
dlls/msxml3/tests/saxreader.c
+96
-12
No files found.
dlls/msxml3/mxwriter.c
View file @
92668f1d
...
...
@@ -46,6 +46,8 @@ typedef struct _mxwriter
LONG
ref
;
VARIANT_BOOL
standalone
;
IStream
*
dest
;
}
mxwriter
;
static
inline
mxwriter
*
impl_from_IMXWriter
(
IMXWriter
*
iface
)
...
...
@@ -103,7 +105,10 @@ static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
dest
)
IStream_Release
(
This
->
dest
);
heap_free
(
This
);
}
return
ref
;
}
...
...
@@ -183,8 +188,39 @@ static HRESULT WINAPI mxwriter_Invoke(
static
HRESULT
WINAPI
mxwriter_put_output
(
IMXWriter
*
iface
,
VARIANT
dest
)
{
mxwriter
*
This
=
impl_from_IMXWriter
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
dest
));
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
dest
));
switch
(
V_VT
(
&
dest
))
{
case
VT_EMPTY
:
{
if
(
This
->
dest
)
IStream_Release
(
This
->
dest
);
This
->
dest
=
NULL
;
break
;
}
case
VT_UNKNOWN
:
{
IStream
*
stream
;
HRESULT
hr
;
hr
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
&
dest
),
&
IID_IStream
,
(
void
**
)
&
stream
);
if
(
hr
==
S_OK
)
{
if
(
This
->
dest
)
IStream_Release
(
This
->
dest
);
This
->
dest
=
stream
;
break
;
}
FIXME
(
"unhandled interface type for VT_UNKNOWN destination
\n
"
);
return
E_NOTIMPL
;
}
default:
FIXME
(
"unhandled destination type %s
\n
"
,
debugstr_variant
(
&
dest
));
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
mxwriter_get_output
(
IMXWriter
*
iface
,
VARIANT
*
dest
)
...
...
@@ -511,6 +547,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
This
->
ref
=
1
;
This
->
standalone
=
VARIANT_FALSE
;
This
->
dest
=
NULL
;
*
ppObj
=
&
This
->
IMXWriter_iface
;
...
...
dlls/msxml3/tests/saxreader.c
View file @
92668f1d
...
...
@@ -669,11 +669,6 @@ static void test_mxwriter_contenthandler(void)
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"MXXMLWriter not supported
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
EXPECT_REF
(
writer
,
1
);
...
...
@@ -702,11 +697,6 @@ static void test_mxwriter_properties(void)
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"MXXMLWriter not supported
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
hr
=
IMXWriter_get_standalone
(
writer
,
NULL
);
...
...
@@ -729,9 +719,92 @@ static void test_mxwriter_properties(void)
IMXWriter_Release
(
writer
);
}
static
void
test_mxwriter_flush
(
void
)
{
ISAXContentHandler
*
content
;
IMXWriter
*
writer
;
LARGE_INTEGER
pos
;
ULARGE_INTEGER
pos2
;
IStream
*
stream
;
VARIANT
dest
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
EXPECT_REF
(
stream
,
1
);
/* detach whe nothing was attached */
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* attach stream */
V_VT
(
&
dest
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
dest
)
=
(
IUnknown
*
)
stream
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
todo_wine
EXPECT_REF
(
stream
,
3
);
/* detach setting VT_EMPTY destination */
V_VT
(
&
dest
)
=
VT_EMPTY
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
EXPECT_REF
(
stream
,
1
);
V_VT
(
&
dest
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
dest
)
=
(
IUnknown
*
)
stream
;
hr
=
IMXWriter_put_output
(
writer
,
dest
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* flush() doesn't detach a stream */
hr
=
IMXWriter_flush
(
writer
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
EXPECT_REF
(
stream
,
3
);
}
pos
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_CUR
,
&
pos2
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
pos2
.
QuadPart
==
0
,
"expected stream beginning
\n
"
);
hr
=
IMXWriter_QueryInterface
(
writer
,
&
IID_ISAXContentHandler
,
(
void
**
)
&
content
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_startDocument
(
content
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
pos
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_CUR
,
&
pos2
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
todo_wine
ok
(
pos2
.
QuadPart
!=
0
,
"expected stream beginning
\n
"
);
/* already started */
hr
=
ISAXContentHandler_startDocument
(
content
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ISAXContentHandler_endDocument
(
content
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
/* flushed on endDocument() */
pos
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
stream
,
pos
,
STREAM_SEEK_CUR
,
&
pos2
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
todo_wine
ok
(
pos2
.
QuadPart
!=
0
,
"expected stream position moved
\n
"
);
ISAXContentHandler_Release
(
content
);
IStream_Release
(
stream
);
IMXWriter_Release
(
writer
);
}
START_TEST
(
saxreader
)
{
ISAXXMLReader
*
reader
;
IMXWriter
*
writer
;
HRESULT
hr
;
hr
=
CoInitialize
(
NULL
);
...
...
@@ -750,8 +823,19 @@ START_TEST(saxreader)
test_saxreader
();
test_encoding
();
test_mxwriter_contenthandler
();
test_mxwriter_properties
();
hr
=
CoCreateInstance
(
&
CLSID_MXXMLWriter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXWriter
,
(
void
**
)
&
writer
);
if
(
hr
==
S_OK
)
{
IMXWriter_Release
(
writer
);
test_mxwriter_contenthandler
();
test_mxwriter_properties
();
test_mxwriter_flush
();
}
else
win_skip
(
"MXXMLWriter not supported
\n
"
);
CoUninitialize
();
}
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