ERROR_VC_DISCONNECTED - 240 (0xF0)

The session was canceled.

Updated: Feb 21, 2026

Technical Meaning

The ERROR_VC_DISCONNECTED error code indicates that a virtual console session has been terminated or canceled. This can occur in various contexts, such as when a user logs off, the system is shut down, or an application explicitly closes its session.

Error Details

  • Error Name: ERROR_VC_DISCONNECTED
  • Numeric Code: 240 (0xF0)
  • Short Description: The session was canceled.

This error code is typically returned by functions that manage virtual console sessions, such as those used in terminal services or command-line interfaces. It signifies that the operation could not proceed because the associated session has been terminated.

Usage Context

The ERROR_VC_DISCONNECTED error can be encountered when working with processes and their associated sessions. For example, if a process attempts to write to a console buffer after its session has been closed, this error will be returned.

Developer Interpretation

When encountering the ERROR_VC_DISCONNECTED error, developers should understand that the operation cannot proceed because the session is no longer active. This can happen due to various reasons such as user logoff, system shutdown, or explicit session termination by an application. Developers should handle this error gracefully and ensure that operations dependent on a specific session are properly managed.

Related Errors

  • ERROR_SESSION_CREDENTIAL_CONFLICT (0x8009201D): This error can occur when there is a conflict in session credentials, which might indirectly lead to the ERROR_VC_DISCONNECTED if it results in session termination.
  • ERROR_INVALID_PARAMETER (0x80070057): If an invalid parameter was passed to a function that manages sessions, this could result in the session being terminated and subsequently cause the ERROR_VC_DISCONNECTED error.

FAQ

Q: What does the ERROR_VC_DISCONNECTED error mean?

A: It indicates that a virtual console session has been canceled or terminated. This can happen due to user logoff, system shutdown, or explicit termination by an application.

Q: How should I handle this error in my code?

A: You should ensure that your code handles the ERROR_VC_DISCONNECTED gracefully and does not attempt operations on a session that has been terminated. This might involve checking for active sessions before performing certain actions.

Summary

The ERROR_VC_DISCONNECTED error is a generic indication that a virtual console session has been canceled, which can occur due to various reasons such as user logoff or explicit termination by an application. Developers should handle this error appropriately and ensure that their code does not attempt operations on terminated sessions.