WTSQuerySessionInformation

[DllImport("wtsapi32.dll", SetLastError = true)]
public static extern bool WTSQuerySessionInformation(
   IntPtr hServer,
   int SessionId,
   WTS_INFO_CLASS WTSInfoClass,
   ref IntPtr ppBuffer,
   ref int pBytesReturned
);

Microsoft documentation: Link

Last updated