Hans Leidekker : msado15: Implement _Stream_get_Mode and _Stream_put_Mode.
Module: wine Branch: master Commit: c66411f742b417de80d2c331c30ebae04dde71f5 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c66411f742b417de80d2c331c... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 10 11:11:21 2019 +0100 msado15: Implement _Stream_get_Mode and _Stream_put_Mode. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/stream.c | 15 +++++++++++---- dlls/msado15/tests/msado15.c | 9 +++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/msado15/stream.c b/dlls/msado15/stream.c index 07027f3829..9aa35d5831 100644 --- a/dlls/msado15/stream.c +++ b/dlls/msado15/stream.c @@ -35,6 +35,7 @@ struct stream _Stream Stream_iface; LONG refs; ObjectStateEnum state; + ConnectModeEnum mode; StreamTypeEnum type; LineSeparatorEnum sep; LONG size; @@ -221,14 +222,20 @@ static HRESULT WINAPI stream_get_State( _Stream *iface, ObjectStateEnum *state ) static HRESULT WINAPI stream_get_Mode( _Stream *iface, ConnectModeEnum *mode ) { - FIXME( "%p, %p\n", iface, mode ); - return E_NOTIMPL; + struct stream *stream = impl_from_Stream( iface ); + TRACE( "%p, %p\n", stream, mode ); + + *mode = stream->mode; + return S_OK; } static HRESULT WINAPI stream_put_Mode( _Stream *iface, ConnectModeEnum mode ) { - FIXME( "%p, %u\n", iface, mode ); - return E_NOTIMPL; + struct stream *stream = impl_from_Stream( iface ); + TRACE( "%p, %u\n", stream, mode ); + + stream->mode = mode; + return S_OK; } static HRESULT WINAPI stream_get_Charset( _Stream *iface, BSTR *charset ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index a4de15932d..6aab518da9 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -54,6 +54,7 @@ static void test_Stream(void) LineSeparatorEnum sep; LONG refs, size, pos; ObjectStateEnum state; + ConnectModeEnum mode; VARIANT missing, val; HRESULT hr; @@ -103,6 +104,14 @@ static void test_Stream(void) ok( hr == S_OK, "got %08x\n", hr ); ok( state == adStateClosed, "got %u\n", state ); + mode = 0xdeadbeef; + hr = _Stream_get_Mode( stream, &mode ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( mode == adModeUnknown, "got %u\n", mode ); + + hr = _Stream_put_Mode( stream, adModeReadWrite ); + ok( hr == S_OK, "got %08x\n", hr ); + hr = _Stream_Read( stream, 2, &val ); ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
participants (1)
-
Alexandre Julliard