Exemplo n.º 1
0
 public static extern int WinStationQueryInformation(
     IntPtr hServer,
     int sessionId,
     int information,
     ref WINSTATIONINFORMATIONW buffer,
     int bufferLength,
     ref int returnedLength);
Exemplo n.º 2
0
        public static WINSTATIONINFORMATIONW GetWinStationInformation(ITerminalServerHandle server, int sessionId)
        {
            var retLen = 0;

            var wsInfo = new WINSTATIONINFORMATIONW();

            if (NativeMethods.WinStationQueryInformation(
                    server.Handle,
                    sessionId,
                    (int)WINSTATIONINFOCLASS.WinStationInformation,
                    ref wsInfo,
                    Marshal.SizeOf(typeof(WINSTATIONINFORMATIONW)),
                    ref retLen) != 0)
            {
                return(wsInfo);
            }

            throw new Win32Exception();
        }