It is said that to shutdown a schannel connection following steps to be followed: 1)Call the ApplyControlToken function, specifying the SCHANNEL_SHUTDOWN control token.
2)After receiving an SEC_E_OK return value from ApplyControlToken, call the InitializeSecurityContext (Schannel) (clients) or AcceptSecurityContext (Schannel) (servers) function, passing in empty buffers.
3)Proceed as though your application were creating a new connection until the function returns SEC_I_CONTEXT_EXPIRED or SEC_E_OK to indicate that the connection is shut down. Send the final output information, if any, to the remote party.
4)Call DeleteSecurityContext to free resources held by the connection.
from the link Shutting Down an Schannel Connection but, do we need to pass the info from both client and server. after passing the info what do we need to do with that information on the remote side.
We can pass the closing note from the side where you sent the last message. DecryptMessage will return the SEC_I_CONTEXT_EXPIRED when the remote connection sent the closing note.