Platform SDK: Logon Authentication

Handling A Shutdown

When EncryptMessage, AcceptSecurityContext, or InitializeSecurityContext return a SEC_E_CONTEXT_EXPIRED warning, the connection is considered shut down. The application sends any output data from AcceptSecurityContext or InitializeSecurityContext to the remote party and delete the security context with DeleteSecurityContext.

If DecryptMessage returns a SEC_E_CONTEXT_EXPIRED warning, the remote party has closed the connection. At this point, the application calls EncryptMessage with an empty input buffer, sends any output data to the remote party, and deletes the security context.