Beispiel #1
0
        private void ConnectToHost()
        {
            Logger.Log("FileShareManagerPlugIn.ConnectToHost", Logger.FileShareManagerLogLevel);

            if (_hn.creds.Invalidated)
            {
                _container.ShowError("File Browser PlugIn cannot connect to domain due to invalid credentials");
                _hn.IsConnectionSuccess = false;
                return;
            }
            if (!String.IsNullOrEmpty(_hn.hostName))
            {
                if (_currentHost != _hn.hostName)
                {
                    if (fileHandle != null)
                    {
                        fileHandle.Dispose();
                        fileHandle = null;
                    }

                    if (_pluginNode != null && !String.IsNullOrEmpty(_hn.hostName))
                    {
                        OpenHandle(_hn.hostName);
                    }

                    _currentHost = _hn.hostName;
                }
                _hn.IsConnectionSuccess = true;
            }
            else
            {
                _hn.IsConnectionSuccess = false;
            }
        }
Beispiel #2
0
            public void Dispose()
            {
                FileHandle.Dispose();

                ThreadPoolBoundHandle.Dispose();

                PreAllocatedOverlapped.Dispose();
            }
Beispiel #3
0
 public void Dispose()
 {
     if (_fileHandle != null)
     {
         try
         {
             _fileHandle.SetHandleFlags(Win32HandleFlags.ProtectFromClose, 0);
             _fileHandle.Dispose();
         }
         catch (Exception)
         { }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Closes the connection to KProcessHacker.
 /// </summary>
 public void Close()
 {
     _fileHandle.SetHandleFlags(Win32HandleFlags.ProtectFromClose, 0);
     _fileHandle.Dispose();
 }