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; } }
public void Dispose() { FileHandle.Dispose(); ThreadPoolBoundHandle.Dispose(); PreAllocatedOverlapped.Dispose(); }
public void Dispose() { if (_fileHandle != null) { try { _fileHandle.SetHandleFlags(Win32HandleFlags.ProtectFromClose, 0); _fileHandle.Dispose(); } catch (Exception) { } } }
/// <summary> /// Closes the connection to KProcessHacker. /// </summary> public void Close() { _fileHandle.SetHandleFlags(Win32HandleFlags.ProtectFromClose, 0); _fileHandle.Dispose(); }