To delete a security context after the client and the server have finished communicating, the client and the server call the DeleteSecurityContext function with their respective context handles. The client should also call the FreeCredentialsHandle function when it has finished communicating with any server or has finished using the additional credentials passed to the AcquireCredentialsHandle function. The server should then call DeleteSecurityContext when it is ready to shut down, but before unloading the DLL.