Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WsShutdownSessionChannel function

Used to signal the end of messages for a session channel.


HRESULT WINAPI  WsShutdownSessionChannel(
  _In_     WS_CHANNEL*             channel,
  _In_opt_ const WS_ASYNC_CONTEXT* asyncContext,
  _In_opt_ WS_ERROR*               error


channel [in]

The session channel to shut down.

asyncContext [in, optional]

Information on how to invoke the function asynchronously, or NULL if invoking synchronously.

error [in, optional]

Specifies where additional error information should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription

This is returned if the channel is not in the WS_CHANNEL_STATE_OPENstate.



This function will indicate to the remote party that all messages have been sent for the channel.

The remote party can detect that no more messages are available on the channel by looking for the WS_S_END return value when receiving a message. (See Windows Web Services Return Values.) However, messages can also become unavailable if the non-application messages were filtered by the channel as described in Channel Layer Overview. Session shutdown can be distinguished from message filtering by keeping track of whether prior messages were received. If prior messages were received then the session was shut down.

This function only applies to channels created with a WS_CHANNEL_TYPE with a session that support sending of messages:

The channel must be in WS_CHANNEL_STATE_OPEN state.

If this function is successful, the value of the WS_CHANNEL_PROPERTY_IS_SESSION_SHUT_DOWN property will be TRUE.

Once a session channel has been shut down, attempting to send a message on the channel or attempting to shut down the channel will return WS_E_INVALID_OPERATION.

Calling this function is optional. When a session channel is closed using WsCloseChannel when in WS_CHANNEL_STATE_OPEN, then the channel is automatically shut down as part of the close process.


Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]









Community Additions

© 2017 Microsoft