Hans Leidekker : msado15: Implement _Stream_get_EOS.

Alexandre Julliard julliard at winehq.org
Tue Dec 10 15:58:49 CST 2019


Module: wine
Branch: master
Commit: 74410ebb26b3a3bed7b178dd5a84aa70e3298f8e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=74410ebb26b3a3bed7b178dd5a84aa70e3298f8e

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Dec 10 11:11:19 2019 +0100

msado15: Implement _Stream_get_EOS.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 );




More information about the wine-cvs mailing list