mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Remotely_Library.Win32_Classes
|
|
{
|
|
public static class WTSAPI32
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct WTS_SESSION_INFO
|
|
{
|
|
public Int32 SessionID;
|
|
[MarshalAs(UnmanagedType.LPStr)]
|
|
public String pWinStationName;
|
|
public WTS_CONNECTSTATE_CLASS State;
|
|
}
|
|
public enum WTS_CONNECTSTATE_CLASS
|
|
{
|
|
WTSActive,
|
|
WTSConnected,
|
|
WTSConnectQuery,
|
|
WTSShadow,
|
|
WTSDisconnected,
|
|
WTSIdle,
|
|
WTSListen,
|
|
WTSReset,
|
|
WTSDown,
|
|
WTSInit
|
|
}
|
|
public static IntPtr WTS_CURRENT_SERVER_HANDLE = IntPtr.Zero;
|
|
|
|
[DllImport("wtsapi32.dll", SetLastError = true)]
|
|
static extern IntPtr WTSOpenServer(string pServerName);
|
|
|
|
[DllImport("wtsapi32.dll", SetLastError = true)]
|
|
public static extern int WTSEnumerateSessions(
|
|
System.IntPtr hServer,
|
|
int Reserved,
|
|
int Version,
|
|
ref System.IntPtr ppSessionInfo,
|
|
ref int pCount);
|
|
|
|
}
|
|
}
|