C# Class dlech.SshAgentLib.WinInternals

Show file Open project: dlech/SshAgentLib

Public Methods

Method Description
FindProcessWithMatchingHandle ( MemoryMappedFile mmf ) : Process

Iterates all open handles on the system (using internal system call) to find the other process that has a handle open to the same memtory mapped file.

Code based on http://forum.sysinternals.com/overview-handle-enumeration_topic14546.html

GetProcessForTcpPort ( IPEndPoint localEndpoint, IPEndPoint remoteEndpoint ) : Process

Searches all current TCP connections (IPv4 only) for the matching port (local port of the connection).

Private Methods

Method Description
GetExtendedTcpTable ( IntPtr pTcpTable, UInt32 &pdwSize, System.Boolean bOrder, UInt32 ulAf, TCP_TABLE_CLASS TableClass, UInt32 Reserved ) : UInt32
NtQuerySystemInformation ( SYSTEM_INFORMATION_CLASS SystemInformationClass, IntPtr SystemInformation, UInt32 Length, UInt32 &ResultLength ) : NTSTATUS

Method Details

FindProcessWithMatchingHandle() public static method

Iterates all open handles on the system (using internal system call) to find the other process that has a handle open to the same memtory mapped file.
Code based on http://forum.sysinternals.com/overview-handle-enumeration_topic14546.html
public static FindProcessWithMatchingHandle ( MemoryMappedFile mmf ) : Process
mmf System.IO.MemoryMappedFiles.MemoryMappedFile
return System.Diagnostics.Process

GetProcessForTcpPort() public static method

Searches all current TCP connections (IPv4 only) for the matching port (local port of the connection).
public static GetProcessForTcpPort ( IPEndPoint localEndpoint, IPEndPoint remoteEndpoint ) : Process
localEndpoint System.Net.IPEndPoint
remoteEndpoint System.Net.IPEndPoint
return System.Diagnostics.Process