188.8.131.52.1 User-Initiated on Client
The user can initiate a client-side disconnect by closing the RDP client application. To implement this type of disconnection the client sends the server a Shutdown Request PDU. The server response to this PDU is determined by whether the session is associated with a logged-on user account.
If a logged-on user account is associated with the session, the server always denies the shutdown request and sends the client a Shutdown Request Denied PDU. At this point the client behavior is implementation-dependent (the client may, for example, choose to display a dialog box specifying that the session will be disconnected). If the decision is made to proceed with the disconnection, the client sends the server an MCS Disconnect Provider Ultimatum PDU (with the reason code set to "user requested") and closes the connection.
If a logged-on user account is not associated with the session, the server closes the connection immediately after receiving the Shutdown Request PDU.
The sending and processing of the Shutdown Request PDU is described in sections 184.108.40.206.1 and 220.127.116.11.1 respectively. The sending and processing of the Shutdown Request Denied PDU is described in sections 18.104.22.168.2 and 22.214.171.124.2 respectively.