/[AnywhereTS-MSSQL]/branches/TerminalServices/TSAdminTool/TerminalServices.cs
ViewVC logotype

Diff of /branches/TerminalServices/TSAdminTool/TerminalServices.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 241 by william, Sat Aug 25 16:40:35 2012 UTC revision 242 by william, Sat Aug 25 16:49:29 2012 UTC
# Line 290  namespace AnywhereTS Line 290  namespace AnywhereTS
290              public int HorizontalResolution; // horizontal dimensions, in pixels              public int HorizontalResolution; // horizontal dimensions, in pixels
291              public int VerticalResolution;   // vertical dimensions, in pixels              public int VerticalResolution;   // vertical dimensions, in pixels
292              public int ColorDepth;           // 1=16, 2=256, 4=64K, 8=16M              public int ColorDepth;           // 1=16, 2=256, 4=64K, 8=16M
293                /// <summary>
294                /// Returns a WTS_CLIENT_DISPLAY instance initialized to default values
295                /// </summary>
296                public static WTS_CLIENT_DISPLAY Empty
297                {
298                    get
299                    {
300                        WTS_CLIENT_DISPLAY t = new WTS_CLIENT_DISPLAY();
301                        t.HorizontalResolution = 0;
302                        t.VerticalResolution = 0;
303                        t.ColorDepth = 0;
304                        return t;
305                    }
306                }
307          };          };
308          // Selected info for terminal server sessions          // Selected info for terminal server sessions
309          public struct TS_SESSION_INFO          public struct TS_SESSION_INFO
# Line 408  namespace AnywhereTS Line 422  namespace AnywhereTS
422          // In: SessionID = identifier for the session          // In: SessionID = identifier for the session
423          // In: server = server handle for the server that the session resides on.            // In: server = server handle for the server that the session resides on.  
424          private static void GetTSClientDisplay(int sessionID, IntPtr server, out int horizontalResolution, out int verticalResolution, out int colorDepth)          private static void GetTSClientDisplay(int sessionID, IntPtr server, out int horizontalResolution, out int verticalResolution, out int colorDepth)
425          {                      {
426              horizontalResolution = 0;              WTS_CLIENT_DISPLAY clientDisplay = WTS_CLIENT_DISPLAY.Empty;
427              verticalResolution = 0;              horizontalResolution = clientDisplay.HorizontalResolution;
428              colorDepth = 0;              verticalResolution = clientDisplay.VerticalResolution;
429                colorDepth = clientDisplay.ColorDepth;
430              System.IntPtr ppBuffer = System.IntPtr.Zero;              System.IntPtr ppBuffer = System.IntPtr.Zero;
431              uint pBytesReturned = 0;              uint pBytesReturned = 0;
432              StringBuilder sDisplay = new StringBuilder();              StringBuilder sDisplay = new StringBuilder();          
   
             WTS_CLIENT_DISPLAY clientDisplay = new WTS_CLIENT_DISPLAY();  
             clientDisplay.HorizontalResolution = 0;  
             clientDisplay.VerticalResolution = 0;  
             clientDisplay.ColorDepth = 0;  
   
             Type dataType = typeof(WTS_CLIENT_DISPLAY);  
   
433              if (WTSQuerySessionInformation(              if (WTSQuerySessionInformation(
434                  server,                  server,
435                  sessionID,                  sessionID,
# Line 431  namespace AnywhereTS Line 437  namespace AnywhereTS
437                  out ppBuffer,                  out ppBuffer,
438                  out pBytesReturned))                  out pBytesReturned))
439              {              {
440                  clientDisplay = (WTS_CLIENT_DISPLAY)Marshal.PtrToStructure(ppBuffer, dataType);                  clientDisplay = (WTS_CLIENT_DISPLAY)Marshal.PtrToStructure(ppBuffer, typeof(WTS_CLIENT_DISPLAY));
441                  horizontalResolution = (int)(clientDisplay.HorizontalResolution);                  horizontalResolution = clientDisplay.HorizontalResolution;
442                  verticalResolution = (int)(clientDisplay.VerticalResolution);                  verticalResolution = clientDisplay.VerticalResolution;
443                  colorDepth = (int)(clientDisplay.ColorDepth);                  colorDepth = clientDisplay.ColorDepth;
444              }              }
445                LogDebugVerboseMessage("GetTSClientDisplay::server.ToInt32()={0}", server.ToInt32());
446                LogDebugVerboseMessage("GetTSClientDisplay::sessionID={0}", sessionID);
447              LogDebugVerboseMessage("GetTSClientDisplay::horizontalResolution={0}", horizontalResolution);              LogDebugVerboseMessage("GetTSClientDisplay::horizontalResolution={0}", horizontalResolution);
448              LogDebugVerboseMessage("GetTSClientDisplay::verticalResolution={0}", verticalResolution);              LogDebugVerboseMessage("GetTSClientDisplay::verticalResolution={0}", verticalResolution);
449              LogDebugVerboseMessage("GetTSClientDisplay::colorDepth={0}", colorDepth);              LogDebugVerboseMessage("GetTSClientDisplay::colorDepth={0}", colorDepth);

Legend:
Removed from v.241  
changed lines
  Added in v.242

  ViewVC Help
Powered by ViewVC 1.1.22