Commit 6463db0c authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msado15: Implement _Stream_get_State.

parent 5290480c
......@@ -162,8 +162,11 @@ static HRESULT WINAPI stream_put_LineSeparator( _Stream *iface, LineSeparatorEnu
static HRESULT WINAPI stream_get_State( _Stream *iface, ObjectStateEnum *state )
{
FIXME( "%p, %p\n", iface, state );
return E_NOTIMPL;
struct stream *stream = impl_from_Stream( iface );
TRACE( "%p, %p\n", stream, state );
*state = stream->state;
return S_OK;
}
static HRESULT WINAPI stream_get_Mode( _Stream *iface, ConnectModeEnum *mode )
......
......@@ -30,6 +30,7 @@ static void test_Stream(void)
_Stream *stream;
StreamTypeEnum type;
LONG refs;
ObjectStateEnum state;
VARIANT missing;
HRESULT hr;
......@@ -54,6 +55,11 @@ static void test_Stream(void)
hr = _Stream_put_Type( stream, adTypeText );
ok( hr == S_OK, "got %08x\n", hr );
state = 0xdeadbeef;
hr = _Stream_get_State( stream, &state );
ok( hr == S_OK, "got %08x\n", hr );
ok( state == adStateClosed, "got %u\n", state );
V_VT( &missing ) = VT_ERROR;
V_ERROR( &missing ) = DISP_E_PARAMNOTFOUND;
hr = _Stream_Open( stream, missing, adModeUnknown, adOpenStreamUnspecified, NULL, NULL );
......@@ -62,9 +68,19 @@ static void test_Stream(void)
hr = _Stream_Open( stream, missing, adModeUnknown, adOpenStreamUnspecified, NULL, NULL );
ok( hr == MAKE_ADO_HRESULT( adErrObjectOpen ), "got %08x\n", hr );
state = 0xdeadbeef;
hr = _Stream_get_State( stream, &state );
ok( hr == S_OK, "got %08x\n", hr );
ok( state == adStateOpen, "got %u\n", state );
hr = _Stream_Close( stream );
ok( hr == S_OK, "got %08x\n", hr );
state = 0xdeadbeef;
hr = _Stream_get_State( stream, &state );
ok( hr == S_OK, "got %08x\n", hr );
ok( state == adStateClosed, "got %u\n", state );
hr = _Stream_Close( stream );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "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