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
4e3283fd
Commit
4e3283fd
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: Add IXmlReaderInput stub implementation.
parent
5c1f0dba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
12 deletions
+91
-12
reader.c
dlls/xmllite/reader.c
+84
-2
reader.c
dlls/xmllite/tests/reader.c
+7
-10
No files found.
dlls/xmllite/reader.c
View file @
4e3283fd
...
@@ -31,17 +31,31 @@
...
@@ -31,17 +31,31 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
xmllite
);
WINE_DEFAULT_DEBUG_CHANNEL
(
xmllite
);
/* not defined in public headers */
DEFINE_GUID
(
IID_IXmlReaderInput
,
0x0b3ccc9b
,
0x9214
,
0x428b
,
0xa2
,
0xae
,
0xef
,
0x3a
,
0xa8
,
0x71
,
0xaf
,
0xda
);
typedef
struct
_xmlreader
typedef
struct
_xmlreader
{
{
const
IXmlReaderVtbl
*
lpVtbl
;
const
IXmlReaderVtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
}
xmlreader
;
}
xmlreader
;
typedef
struct
_xmlreaderinput
{
const
IUnknownVtbl
*
lpVtbl
;
LONG
ref
;
}
xmlreaderinput
;
static
inline
xmlreader
*
impl_from_IXmlReader
(
IXmlReader
*
iface
)
static
inline
xmlreader
*
impl_from_IXmlReader
(
IXmlReader
*
iface
)
{
{
return
(
xmlreader
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
xmlreader
,
lpVtbl
));
return
(
xmlreader
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
xmlreader
,
lpVtbl
));
}
}
static
inline
xmlreaderinput
*
impl_from_IXmlReaderInput
(
IXmlReaderInput
*
iface
)
{
return
(
xmlreaderinput
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
xmlreaderinput
,
lpVtbl
));
}
static
HRESULT
WINAPI
xmlreader_QueryInterface
(
IXmlReader
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
static
HRESULT
WINAPI
xmlreader_QueryInterface
(
IXmlReader
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
{
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
xmlreader
*
This
=
impl_from_IXmlReader
(
iface
);
...
@@ -271,6 +285,59 @@ static const struct IXmlReaderVtbl xmlreader_vtbl =
...
@@ -271,6 +285,59 @@ static const struct IXmlReaderVtbl xmlreader_vtbl =
xmlreader_IsEOF
xmlreader_IsEOF
};
};
/* IXmlReaderInput */
static
HRESULT
WINAPI
xmlreaderinput_QueryInterface
(
IXmlReaderInput
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
xmlreaderinput
*
This
=
impl_from_IXmlReaderInput
(
iface
);
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualGUID
(
riid
,
&
IID_IXmlReaderInput
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
*
ppvObject
=
iface
;
}
else
{
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
static
ULONG
WINAPI
xmlreaderinput_AddRef
(
IXmlReaderInput
*
iface
)
{
xmlreaderinput
*
This
=
impl_from_IXmlReaderInput
(
iface
);
TRACE
(
"%p
\n
"
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
xmlreaderinput_Release
(
IXmlReaderInput
*
iface
)
{
xmlreaderinput
*
This
=
impl_from_IXmlReaderInput
(
iface
);
LONG
ref
;
TRACE
(
"%p
\n
"
,
This
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
const
struct
IUnknownVtbl
xmlreaderinput_vtbl
=
{
xmlreaderinput_QueryInterface
,
xmlreaderinput_AddRef
,
xmlreaderinput_Release
};
HRESULT
WINAPI
CreateXmlReader
(
REFIID
riid
,
void
**
pObject
,
IMalloc
*
pMalloc
)
HRESULT
WINAPI
CreateXmlReader
(
REFIID
riid
,
void
**
pObject
,
IMalloc
*
pMalloc
)
{
{
xmlreader
*
reader
;
xmlreader
*
reader
;
...
@@ -305,7 +372,22 @@ HRESULT WINAPI CreateXmlReaderInputWithEncodingName(IUnknown *stream,
...
@@ -305,7 +372,22 @@ HRESULT WINAPI CreateXmlReaderInputWithEncodingName(IUnknown *stream,
LPCWSTR
base_uri
,
LPCWSTR
base_uri
,
IXmlReaderInput
**
ppInput
)
IXmlReaderInput
**
ppInput
)
{
{
FIXME
(
"%p %p %s %d %s %p
\n
"
,
stream
,
pMalloc
,
wine_dbgstr_w
(
encoding
),
xmlreaderinput
*
readerinput
;
FIXME
(
"%p %p %s %d %s %p: stub
\n
"
,
stream
,
pMalloc
,
wine_dbgstr_w
(
encoding
),
hint
,
wine_dbgstr_w
(
base_uri
),
ppInput
);
hint
,
wine_dbgstr_w
(
base_uri
),
ppInput
);
return
E_NOTIMPL
;
if
(
!
stream
||
!
ppInput
)
return
E_INVALIDARG
;
readerinput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
readerinput
));
if
(
!
readerinput
)
return
E_OUTOFMEMORY
;
readerinput
->
lpVtbl
=
&
xmlreaderinput_vtbl
;
readerinput
->
ref
=
1
;
*
ppInput
=
(
IXmlReaderInput
*
)
&
readerinput
->
lpVtbl
;
TRACE
(
"returning iface %p
\n
"
,
*
ppInput
);
return
S_OK
;
}
}
dlls/xmllite/tests/reader.c
View file @
4e3283fd
...
@@ -218,9 +218,9 @@ static void test_readerinput(void)
...
@@ -218,9 +218,9 @@ static void test_readerinput(void)
LONG
ref
;
LONG
ref
;
hr
=
pCreateXmlReaderInputWithEncodingName
(
NULL
,
NULL
,
NULL
,
FALSE
,
NULL
,
NULL
);
hr
=
pCreateXmlReaderInputWithEncodingName
(
NULL
,
NULL
,
NULL
,
FALSE
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
hr
=
pCreateXmlReaderInputWithEncodingName
(
NULL
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
reader_input
);
hr
=
pCreateXmlReaderInputWithEncodingName
(
NULL
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
reader_input
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
...
@@ -229,17 +229,11 @@ static void test_readerinput(void)
...
@@ -229,17 +229,11 @@ static void test_readerinput(void)
ok
(
ref
==
2
,
"Expected 2, got %d
\n
"
,
ref
);
ok
(
ref
==
2
,
"Expected 2, got %d
\n
"
,
ref
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
hr
=
pCreateXmlReaderInputWithEncodingName
((
IUnknown
*
)
stream
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
reader_input
);
hr
=
pCreateXmlReaderInputWithEncodingName
((
IUnknown
*
)
stream
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
reader_input
);
todo_wine
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
skip
(
"CreateXmlReaderInputWithEncodingName not implemented
\n
"
);
IStream_Release
(
stream
);
return
;
}
/* IXmlReader grabs a stream reference */
/* IXmlReader grabs a stream reference */
ref
=
IStream_AddRef
(
stream
);
ref
=
IStream_AddRef
(
stream
);
ok
(
ref
==
3
,
"Expected 3, got %d
\n
"
,
ref
);
todo_wine
ok
(
ref
==
3
,
"Expected 3, got %d
\n
"
,
ref
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
/* IID_IXmlReaderInput */
/* IID_IXmlReaderInput */
...
@@ -249,6 +243,9 @@ static void test_readerinput(void)
...
@@ -249,6 +243,9 @@ static void test_readerinput(void)
obj
=
(
IUnknown
*
)
0xdeadbeef
;
obj
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
IUnknown_QueryInterface
(
reader_input
,
&
IID_IXmlReaderInput
,
(
void
**
)
&
obj
);
hr
=
IUnknown_QueryInterface
(
reader_input
,
&
IID_IXmlReaderInput
,
(
void
**
)
&
obj
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ref
=
IUnknown_AddRef
(
reader_input
);
ok
(
ref
==
3
,
"Expected 3, got %d
\n
"
,
ref
);
IUnknown_Release
(
reader_input
);
IUnknown_Release
(
reader_input
);
IUnknown_Release
(
reader_input
);
IStream_Release
(
stream
);
IStream_Release
(
stream
);
...
...
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