/[AnywhereTS-MSSQL]/branches/TerminalServices/3rdparty/Cassia-2.0.0.60/Source/Cassia/Impl/RemoteServerHandle.cs
ViewVC logotype

Diff of /branches/TerminalServices/3rdparty/Cassia-2.0.0.60/Source/Cassia/Impl/RemoteServerHandle.cs

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

--- branches/TerminalServices/3rdparty/Cassia-2.0.0.60/Source/Cassia/Impl/RemoteServerHandle.cs	2012/08/26 00:37:13	281
+++ branches/TerminalServices/3rdparty/Cassia-2.0.0.60/Source/Cassia/Impl/RemoteServerHandle.cs	2012/08/26 00:40:26	282
@@ -48,17 +48,16 @@
             get { return _serverPtr != IntPtr.Zero; }
         }
 
-        public void Open()
+        public bool Open()
         {
-            if (_serverPtr != IntPtr.Zero)
+            try
             {
-                return;
+                _serverPtr = NativeMethods.WTSOpenServer(_serverName);
+                return true;
             }
-            _serverPtr = NativeMethods.WTSOpenServer(_serverName);
-            if (_serverPtr == IntPtr.Zero)
+            catch (Exception)
             {
-                // Failed to connect, possibly because Terminal Services is not running on the remote machine.
-                throw new Win32Exception();
+                return false;
             }
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22