Commit 64254a0a authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

webservices: Implement WsGetChannelProperty(WS_CHANNEL_PROPERTY_STATE).

parent 19c9969c
...@@ -672,6 +672,11 @@ HRESULT WINAPI WsGetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID ...@@ -672,6 +672,11 @@ HRESULT WINAPI WsGetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID
else *(WS_ENCODING *)buf = channel->encoding; else *(WS_ENCODING *)buf = channel->encoding;
break; break;
case WS_CHANNEL_PROPERTY_STATE:
if (!buf || size != sizeof(channel->state)) hr = E_INVALIDARG;
else *(WS_CHANNEL_STATE *)buf = channel->state;
break;
default: default:
hr = prop_get( channel->prop, channel->prop_count, id, buf, size ); hr = prop_get( channel->prop, channel->prop_count, id, buf, size );
} }
......
...@@ -117,6 +117,7 @@ static void test_WsOpenChannel(void) ...@@ -117,6 +117,7 @@ static void test_WsOpenChannel(void)
{ {
HRESULT hr; HRESULT hr;
WS_CHANNEL *channel; WS_CHANNEL *channel;
WS_CHANNEL_STATE state;
WS_ENDPOINT_ADDRESS addr; WS_ENDPOINT_ADDRESS addr;
hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, 0, NULL, &channel, NULL ); hr = WsCreateChannel( WS_CHANNEL_TYPE_REQUEST, WS_HTTP_CHANNEL_BINDING, NULL, 0, NULL, &channel, NULL );
...@@ -141,12 +142,22 @@ static void test_WsOpenChannel(void) ...@@ -141,12 +142,22 @@ static void test_WsOpenChannel(void)
hr = WsOpenChannel( channel, &addr, NULL, NULL ); hr = WsOpenChannel( channel, &addr, NULL, NULL );
ok( hr == S_OK, "got %08x\n", hr ); 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 ); hr = WsOpenChannel( channel, &addr, NULL, NULL );
ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr );
hr = WsCloseChannel( channel, NULL, NULL ); hr = WsCloseChannel( channel, NULL, NULL );
ok( hr == S_OK, "got %08x\n", hr ); 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 ); hr = WsCloseChannel( channel, NULL, NULL );
ok( hr == S_OK, "got %08x\n", hr ); 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