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
707ab559
Commit
707ab559
authored
Apr 11, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Fix IID argument handling in CreateXmlWriter().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d1e14576
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
writer.c
dlls/xmllite/tests/writer.c
+12
-0
writer.c
dlls/xmllite/writer.c
+13
-11
No files found.
dlls/xmllite/tests/writer.c
View file @
707ab559
...
...
@@ -237,6 +237,7 @@ static void test_writer_create(void)
HRESULT
hr
;
IXmlWriter
*
writer
;
LONG_PTR
value
;
IUnknown
*
unk
;
/* crashes native */
if
(
0
)
...
...
@@ -245,6 +246,17 @@ static void test_writer_create(void)
CreateXmlWriter
(
NULL
,
(
void
**
)
&
writer
,
NULL
);
}
hr
=
CreateXmlWriter
(
&
IID_IStream
,
(
void
**
)
&
unk
,
NULL
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08x
\n
"
,
hr
);
hr
=
CreateXmlWriter
(
&
IID_IUnknown
,
(
void
**
)
&
unk
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IXmlWriter
,
(
void
**
)
&
writer
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
unk
==
(
IUnknown
*
)
writer
,
"unexpected interface pointer
\n
"
);
IUnknown_Release
(
unk
);
IXmlWriter_Release
(
writer
);
hr
=
CreateXmlWriter
(
&
IID_IXmlWriter
,
(
void
**
)
&
writer
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
...
...
dlls/xmllite/writer.c
View file @
707ab559
...
...
@@ -458,11 +458,17 @@ static HRESULT WINAPI xmlwriter_QueryInterface(IXmlWriter *iface, REFIID riid, v
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualGUID
(
riid
,
&
IID_I
Unknown
)
||
IsEqualGUID
(
riid
,
&
IID_I
XmlWriter
))
if
(
IsEqualGUID
(
riid
,
&
IID_I
XmlWriter
)
||
IsEqualGUID
(
riid
,
&
IID_I
Unknown
))
{
*
ppvObject
=
iface
;
}
else
{
FIXME
(
"interface %s is not supported
\n
"
,
debugstr_guid
(
riid
));
*
ppvObject
=
NULL
;
return
E_NOINTERFACE
;
}
IXmlWriter_AddRef
(
iface
);
...
...
@@ -1393,15 +1399,10 @@ static const struct IUnknownVtbl xmlwriteroutputvtbl =
HRESULT
WINAPI
CreateXmlWriter
(
REFIID
riid
,
void
**
obj
,
IMalloc
*
imalloc
)
{
xmlwriter
*
writer
;
HRESULT
hr
;
TRACE
(
"(%s, %p, %p)
\n
"
,
wine_dbgstr_guid
(
riid
),
obj
,
imalloc
);
if
(
!
IsEqualGUID
(
riid
,
&
IID_IXmlWriter
))
{
ERR
(
"Unexpected IID requested -> (%s)
\n
"
,
wine_dbgstr_guid
(
riid
));
return
E_FAIL
;
}
if
(
imalloc
)
writer
=
IMalloc_Alloc
(
imalloc
,
sizeof
(
*
writer
));
else
...
...
@@ -1423,11 +1424,12 @@ HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
writer
->
starttagopen
=
FALSE
;
list_init
(
&
writer
->
elements
);
*
obj
=
&
writer
->
IXmlWriter_iface
;
hr
=
IXmlWriter_QueryInterface
(
&
writer
->
IXmlWriter_iface
,
riid
,
obj
);
IXmlWriter_Release
(
&
writer
->
IXmlWriter_iface
);
TRACE
(
"returning iface %p
\n
"
,
*
obj
);
TRACE
(
"returning iface %p
, hr %#x
\n
"
,
*
obj
,
hr
);
return
S_OK
;
return
hr
;
}
static
HRESULT
create_writer_output
(
IUnknown
*
stream
,
IMalloc
*
imalloc
,
xml_encoding
encoding
,
...
...
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