Hans Leidekker : webservices: Implement WsAbortChannel.
Alexandre Julliard
julliard at winehq.org
Tue May 18 15:42:37 CDT 2021
Module: wine
Branch: master
Commit: 180edff83adad627c29930c8e1f4ede20ff9dbdc
URL: https://source.winehq.org/git/wine.git/?a=commit;h=180edff83adad627c29930c8e1f4ede20ff9dbdc
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue May 18 17:19:41 2021 +0200
webservices: Implement WsAbortChannel.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/webservices/channel.c | 42 ++++++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c
index fb9f5b3162c..69ceb2f051e 100644
--- a/dlls/webservices/channel.c
+++ b/dlls/webservices/channel.c
@@ -290,10 +290,37 @@ static void clear_queue( struct queue *queue )
queue->ready = NULL;
}
-static void reset_channel( struct channel *channel )
+static void abort_channel( struct channel *channel )
{
clear_queue( &channel->send_q );
clear_queue( &channel->recv_q );
+}
+
+/**************************************************************************
+ * WsAbortChannel [webservices.@]
+ */
+HRESULT WINAPI WsAbortChannel( WS_CHANNEL *handle, WS_ERROR *error )
+{
+ struct channel *channel = (struct channel *)handle;
+
+ TRACE( "%p %p\n", handle, error );
+
+ EnterCriticalSection( &channel->cs );
+
+ if (channel->magic != CHANNEL_MAGIC)
+ {
+ LeaveCriticalSection( &channel->cs );
+ return E_INVALIDARG;
+ }
+
+ abort_channel( channel );
+
+ LeaveCriticalSection( &channel->cs );
+ return S_OK;
+}
+
+static void reset_channel( struct channel *channel )
+{
channel->state = WS_CHANNEL_STATE_CREATED;
channel->session_state = SESSION_STATE_UNINITIALIZED;
clear_addr( &channel->addr );
@@ -352,6 +379,7 @@ static void free_props( struct channel *channel )
static void free_channel( struct channel *channel )
{
+ abort_channel( channel );
reset_channel( channel );
WsFreeWriter( channel->writer );
@@ -631,7 +659,10 @@ HRESULT WINAPI WsResetChannel( WS_CHANNEL *handle, WS_ERROR *error )
if (channel->state != WS_CHANNEL_STATE_CREATED && channel->state != WS_CHANNEL_STATE_CLOSED)
hr = WS_E_INVALID_OPERATION;
else
+ {
+ abort_channel( channel );
reset_channel( channel );
+ }
LeaveCriticalSection( &channel->cs );
TRACE( "returning %08x\n", hr );
@@ -2521,12 +2552,3 @@ HRESULT channel_accept_udp( SOCKET socket, HANDLE wait, HANDLE cancel, WS_CHANNE
LeaveCriticalSection( &channel->cs );
return hr;
}
-
-/**************************************************************************
- * WsAbortChannel [webservices.@]
- */
-HRESULT WINAPI WsAbortChannel( WS_CHANNEL *handle, WS_ERROR *error )
-{
- FIXME( "%p %p: stub!\n", handle, error );
- return E_NOTIMPL;
-}
More information about the wine-cvs
mailing list