[PATCH 1/5] msado15: Implement _Stream_get_EOS.
Hans Leidekker
hans at codeweavers.com
Tue Dec 10 04:11:19 CST 2019
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
dlls/msado15/stream.c | 9 +++++++--
dlls/msado15/tests/msado15.c | 9 +++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/msado15/stream.c b/dlls/msado15/stream.c
index 169be7319e..9fb6007b57 100644
--- a/dlls/msado15/stream.c
+++ b/dlls/msado15/stream.c
@@ -124,8 +124,13 @@ static HRESULT WINAPI stream_get_Size( _Stream *iface, LONG *size )
static HRESULT WINAPI stream_get_EOS( _Stream *iface, VARIANT_BOOL *eos )
{
- FIXME( "%p, %p\n", iface, eos );
- return E_NOTIMPL;
+ struct stream *stream = impl_from_Stream( iface );
+ TRACE( "%p, %p\n", stream, eos );
+
+ if (stream->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
+
+ *eos = (stream->pos >= stream->size) ? VARIANT_TRUE : VARIANT_FALSE;
+ return S_OK;
}
static HRESULT WINAPI stream_get_Position( _Stream *iface, LONG *pos )
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 1755a7f3da..0b10579905 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -49,6 +49,7 @@ static HRESULT str_to_byte_array( const char *data, VARIANT *ret )
static void test_Stream(void)
{
_Stream *stream;
+ VARIANT_BOOL eos;
StreamTypeEnum type;
LONG refs, size, pos;
ObjectStateEnum state;
@@ -61,6 +62,9 @@ static void test_Stream(void)
hr = _Stream_get_Size( stream, &size );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
+ hr = _Stream_get_EOS( stream, &eos );
+ ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
+
hr = _Stream_get_Position( stream, &pos );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
@@ -111,6 +115,11 @@ static void test_Stream(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( !size, "got %d\n", size );
+ eos = VARIANT_FALSE;
+ hr = _Stream_get_EOS( stream, &eos );
+ ok( hr == S_OK, "got %08x\n", hr );
+ ok( eos == VARIANT_TRUE, "got %04x\n", eos );
+
pos = -1;
hr = _Stream_get_Position( stream, &pos );
ok( hr == S_OK, "got %08x\n", hr );
--
2.20.1
More information about the wine-devel
mailing list