webservices: Implement WsGetChannelProperty(WS_CHANNEL_PROPERTY_STATE).
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
19c9969c79
commit
64254a0a80
|
@ -672,6 +672,11 @@ HRESULT WINAPI WsGetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID
|
|||
else *(WS_ENCODING *)buf = channel->encoding;
|
||||
break;
|
||||
|
||||
case WS_CHANNEL_PROPERTY_STATE:
|
||||
if (!buf || size != sizeof(channel->state)) hr = E_INVALIDARG;
|
||||
else *(WS_CHANNEL_STATE *)buf = channel->state;
|
||||
break;
|
||||
|
||||
default:
|
||||
hr = prop_get( channel->prop, channel->prop_count, id, buf, size );
|
||||
}
|
||||
|
|
|
@ -117,6 +117,7 @@ static void test_WsOpenChannel(void)
|
|||
{
|
||||
HRESULT hr;
|
||||
WS_CHANNEL *channel;
|
||||
WS_CHANNEL_STATE state;
|
||||
WS_ENDPOINT_ADDRESS addr;
|
||||
|
||||
hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, 0, NULL, &channel, NULL );
|
||||
|
@ -141,12 +142,22 @@ static void test_WsOpenChannel(void)
|
|||
hr = WsOpenChannel( channel, &addr, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetChannelProperty( channel, WS_CHANNEL_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( state == WS_CHANNEL_STATE_OPEN, "got %u\n", state );
|
||||
|
||||
hr = WsOpenChannel( channel, &addr, NULL, NULL );
|
||||
ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr );
|
||||
|
||||
hr = WsCloseChannel( channel, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = WsGetChannelProperty( channel, WS_CHANNEL_PROPERTY_STATE, &state, sizeof(state), NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( state == WS_CHANNEL_STATE_CLOSED, "got %u\n", state );
|
||||
|
||||
hr = WsCloseChannel( channel, NULL, NULL );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
||||
|
|
Loading…
Reference in New Issue