diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c index e06b39447fb..de1abb557ca 100644 --- a/dlls/webservices/listener.c +++ b/dlls/webservices/listener.c @@ -644,7 +644,10 @@ HRESULT WINAPI WsAcceptChannel( WS_LISTENER *handle, WS_CHANNEL *channel_handle, return E_INVALIDARG; } - if (listener->state != WS_LISTENER_STATE_OPEN || listener->channel) hr = WS_E_INVALID_OPERATION; + if (listener->state != WS_LISTENER_STATE_OPEN || (listener->channel && listener->channel != channel_handle)) + { + hr = WS_E_INVALID_OPERATION; + } else { wait = listener->wait;