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
89092c92
Commit
89092c92
authored
Jan 21, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Basic input object creation on IXmlReader::SetInput().
parent
4e3283fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
+47
-5
reader.c
dlls/xmllite/reader.c
+37
-2
reader.c
dlls/xmllite/tests/reader.c
+6
-2
xmllite.idl
include/xmllite.idl
+4
-1
No files found.
dlls/xmllite/reader.c
View file @
89092c92
...
...
@@ -38,6 +38,7 @@ typedef struct _xmlreader
{
const
IXmlReaderVtbl
*
lpVtbl
;
LONG
ref
;
IXmlReaderInput
*
input
;
}
xmlreader
;
typedef
struct
_xmlreaderinput
...
...
@@ -95,6 +96,7 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
input
)
IUnknown_Release
(
This
->
input
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -103,8 +105,40 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
static
HRESULT
WINAPI
xmlreader_SetInput
(
IXmlReader
*
iface
,
IUnknown
*
input
)
{
FIXME
(
"(%p %p): stub
\n
"
,
iface
,
input
);
return
E_NOTIMPL
;
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
HRESULT
hr
;
TRACE
(
"(%p %p)
\n
"
,
This
,
input
);
if
(
This
->
input
)
{
IUnknown_Release
(
This
->
input
);
This
->
input
=
NULL
;
}
/* just reset current input */
if
(
!
input
)
return
S_OK
;
/* now try IXmlReaderInput, ISequentialStream, IStream */
hr
=
IUnknown_QueryInterface
(
input
,
&
IID_IXmlReaderInput
,
(
void
**
)
&
This
->
input
);
if
(
hr
!=
S_OK
)
{
IUnknown
*
stream_input
=
NULL
;
hr
=
IUnknown_QueryInterface
(
input
,
&
IID_ISequentialStream
,
(
void
**
)
&
stream_input
);
if
(
hr
!=
S_OK
)
{
hr
=
IUnknown_QueryInterface
(
input
,
&
IID_IStream
,
(
void
**
)
&
stream_input
);
if
(
hr
!=
S_OK
)
return
hr
;
}
/* create IXmlReaderInput basing on supplied interface */
IUnknown_Release
(
stream_input
);
return
CreateXmlReaderInputWithEncodingName
(
stream_input
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
This
->
input
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
xmlreader_GetProperty
(
IXmlReader
*
iface
,
UINT
property
,
LONG_PTR
*
value
)
...
...
@@ -357,6 +391,7 @@ HRESULT WINAPI CreateXmlReader(REFIID riid, void **pObject, IMalloc *pMalloc)
reader
->
lpVtbl
=
&
xmlreader_vtbl
;
reader
->
ref
=
1
;
reader
->
input
=
NULL
;
*
pObject
=
&
reader
->
lpVtbl
;
...
...
dlls/xmllite/tests/reader.c
View file @
89092c92
...
...
@@ -195,14 +195,18 @@ static void test_reader_create(void)
hr
=
IMalloc_DidAlloc
(
imalloc
,
reader
);
ok
(
hr
!=
1
,
"Expected 0 or -1, got %08x
\n
"
,
hr
);
/* Null input pointer, releases previous input */
hr
=
IXmlReader_SetInput
(
reader
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
/* test input interface selection sequence */
hr
=
testinput_createinstance
((
void
**
)
&
input
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
input_iids
.
count
=
0
;
hr
=
IXmlReader_SetInput
(
reader
,
input
);
todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"Expected E_NOINTERFACE, got %08x
\n
"
,
hr
);
ok_iids
(
&
input_iids
,
setinput_full
,
sizeof
(
setinput_full
)
/
sizeof
(
REFIID
),
TRU
E
);
ok
(
hr
==
E_NOINTERFACE
,
"Expected E_NOINTERFACE, got %08x
\n
"
,
hr
);
ok_iids
(
&
input_iids
,
setinput_full
,
sizeof
(
setinput_full
)
/
sizeof
(
REFIID
),
FALS
E
);
IUnknown_Release
(
input
);
...
...
include/xmllite.idl
View file @
89092c92
...
...
@@ -81,4 +81,7 @@ interface IXmlReader : IUnknown
/*
IXmlReader
construction
*/
cpp_quote
(
"STDAPI CreateXmlReader(REFIID riid, void **ppvObject, IMalloc *pMalloc);"
)
typedef
IUnknown
IXmlReaderInput
;
cpp_quote
(
"typedef IUnknown IXmlReaderInput;"
)
cpp_quote
(
"STDAPI CreateXmlReaderInputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,"
)
cpp_quote
(
" LPCWSTR encoding, BOOL hint,"
)
cpp_quote
(
" LPCWSTR base_uri, IXmlReaderInput **ppInput);"
)
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