Getting the Active Console Session ID
The following Winternl.h definition is the static memory address of the active Terminal Services console session ID. This active console session ID is not defined in versions of the Microsoft Windows operating system earlier than Windows XP.
Note
This definition may change in future releases of Windows. To ensure that your application will continue to run correctly in the future, your application must call WTSGetActiveConsoleSessionId.
#define INTERNAL_TS_ACTIVE_CONSOLE_ID
(*((volatile ULONG*)(0x7ffe02d8)))
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for