Commit 74410ebb authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msado15: Implement _Stream_get_EOS.

parent 4d5e1f07
......@@ -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 )
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment