Beispiel #1
0
        public static WINSTATIONINFORMATIONW GetWinStationInformation(int sessionId)
        {
            var retLen = 0;
            var wsInfo = new WINSTATIONINFORMATIONW();

            if (
                WinStationQueryInformation(IntPtr.Zero, sessionId,
                                           (int)WINSTATIONINFOCLASS.WinStationInformation, ref wsInfo,
                                           Marshal.SizeOf(typeof(WINSTATIONINFORMATIONW)), ref retLen) !=
                0)
            {
                return(wsInfo);
            }
            throw new Win32Exception();
        }
Beispiel #2
0
 static extern int WinStationQueryInformation(IntPtr hServer, int sessionId, int information,
                                              ref WINSTATIONINFORMATIONW buffer, int bufferLength,
                                              ref int returnedLength);