Vanara/PInvoke/Kernel32/WtsApi32.cs

17 lines
957 B
C#
Raw Normal View History

namespace Vanara.PInvoke;
2023-03-05 16:41:10 -05:00
public static partial class Kernel32
2018-05-13 23:41:49 -04:00
{
2023-03-05 16:41:10 -05:00
/// <summary>
/// Retrieves the session identifier of the console session. The console session is the session that is currently attached to the
/// physical console. Note that it is not necessary that Remote Desktop Services be running for this function to succeed.
/// </summary>
/// <returns>
/// The session identifier of the session that is attached to the physical console. If there is no session attached to the physical
/// console, (for example, if the physical console session is in the process of being attached or detached), this function returns 0xFFFFFFFF.
/// </returns>
// DWORD WTSGetActiveConsoleSessionId(void); https://msdn.microsoft.com/en-us/library/aa383835(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa383835")]
public static extern uint WTSGetActiveConsoleSessionId();
2018-05-13 23:41:49 -04:00
}