Process Hacker
netprv.c File Reference
#include <phapp.h>
#include <ws2tcpip.h>
#include <ws2ipdef.h>
#include <iphlpapi.h>
#include <extmgri.h>

Go to the source code of this file.

Typedefs

typedef struct
_PH_NETWORK_CONNECTION 
PH_NETWORK_CONNECTION
 
typedef struct
_PH_NETWORK_CONNECTION * 
PPH_NETWORK_CONNECTION
 
typedef struct
_PH_NETWORK_ITEM_QUERY_DATA 
PH_NETWORK_ITEM_QUERY_DATA
 
typedef struct
_PH_NETWORK_ITEM_QUERY_DATA * 
PPH_NETWORK_ITEM_QUERY_DATA
 
typedef struct
_PHP_RESOLVE_CACHE_ITEM 
PHP_RESOLVE_CACHE_ITEM
 
typedef struct
_PHP_RESOLVE_CACHE_ITEM * 
PPHP_RESOLVE_CACHE_ITEM
 
typedef DWORD(WINAPI * _GetExtendedTcpTable )(_Out_writes_bytes_opt_(*pdwSize) PVOID pTcpTable, _Inout_ PDWORD pdwSize, _In_ BOOL bOrder, _In_ ULONG ulAf, _In_ TCP_TABLE_CLASS TableClass, _In_ ULONG Reserved)
 
typedef DWORD(WINAPI * _GetExtendedUdpTable )(_Out_writes_bytes_opt_(*pdwSize) PVOID pUdpTable, _Inout_ PDWORD pdwSize, _In_ BOOL bOrder, _In_ ULONG ulAf, _In_ UDP_TABLE_CLASS TableClass, _In_ ULONG Reserved)
 
typedef int(WSAAPI * _WSAStartup )(_In_ WORD wVersionRequested, _Out_ LPWSADATA lpWSAData)
 
typedef int(WSAAPI * _WSAGetLastError )()
 
typedef INT(WSAAPI * _GetNameInfoW )(_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr, _In_ socklen_t SockaddrLength, _Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer, _In_ DWORD NodeBufferSize, _Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer, _In_ DWORD ServiceBufferSize, _In_ INT Flags)
 
typedef struct hostent *WSAAPI * _gethostbyaddr (_In_reads_bytes_(len) const char *addr, _In_ int len, _In_ int type)
 

Functions

VOID NTAPI PhpNetworkItemDeleteProcedure (_In_ PVOID Object, _In_ ULONG Flags)
 
BOOLEAN PhpNetworkHashtableCompareFunction (_In_ PVOID Entry1, _In_ PVOID Entry2)
 
ULONG NTAPI PhpNetworkHashtableHashFunction (_In_ PVOID Entry)
 
BOOLEAN PhpResolveCacheHashtableCompareFunction (_In_ PVOID Entry1, _In_ PVOID Entry2)
 
ULONG NTAPI PhpResolveCacheHashtableHashFunction (_In_ PVOID Entry)
 
BOOLEAN PhGetNetworkConnections (_Out_ PPH_NETWORK_CONNECTION *Connections, _Out_ PULONG NumberOfConnections)
 
PHAPPAPI PH_CALLBACK_DECLARE (PhNetworkItemAddedEvent)
 
PHAPPAPI PH_CALLBACK_DECLARE (PhNetworkItemModifiedEvent)
 
PHAPPAPI PH_CALLBACK_DECLARE (PhNetworkItemRemovedEvent)
 
PHAPPAPI PH_CALLBACK_DECLARE (PhNetworkItemsUpdatedEvent)
 
BOOLEAN PhNetworkProviderInitialization (VOID)
 
PPH_NETWORK_ITEM PhCreateNetworkItem (VOID)
 
PPH_NETWORK_ITEM PhReferenceNetworkItem (_In_ ULONG ProtocolType, _In_ PPH_IP_ENDPOINT LocalEndpoint, _In_ PPH_IP_ENDPOINT RemoteEndpoint, _In_ HANDLE ProcessId)
 
VOID PhpRemoveNetworkItem (_In_ PPH_NETWORK_ITEM NetworkItem)
 
PPHP_RESOLVE_CACHE_ITEM PhpLookupResolveCacheItem (_In_ PPH_IP_ADDRESS Address)
 
PPH_STRING PhGetHostNameFromAddress (_In_ PPH_IP_ADDRESS Address)
 
NTSTATUS PhpNetworkItemQueryWorker (_In_ PVOID Parameter)
 
VOID PhpQueueNetworkItemQuery (_In_ PPH_NETWORK_ITEM NetworkItem, _In_ BOOLEAN Remote)
 
VOID PhpUpdateNetworkItemOwner (_In_ PPH_NETWORK_ITEM NetworkItem, _In_ PPH_PROCESS_ITEM ProcessItem)
 
VOID PhNetworkProviderUpdate (_In_ PVOID Object)
 
PWSTR PhGetProtocolTypeName (_In_ ULONG ProtocolType)
 
PWSTR PhGetTcpStateName (_In_ ULONG State)
 

Variables

PPH_OBJECT_TYPE PhNetworkItemType
 
PPH_HASHTABLE PhNetworkHashtable
 
PH_QUEUED_LOCK PhNetworkHashtableLock = PH_QUEUED_LOCK_INIT
 
BOOLEAN PhEnableNetworkProviderResolve = TRUE
 
PH_INITONCE PhNetworkProviderWorkQueueInitOnce = PH_INITONCE_INIT
 
PH_WORK_QUEUE PhNetworkProviderWorkQueue
 
SLIST_HEADER PhNetworkItemQueryListHead
 

Typedef Documentation

typedef DWORD(WINAPI * _GetExtendedTcpTable)(_Out_writes_bytes_opt_(*pdwSize) PVOID pTcpTable, _Inout_ PDWORD pdwSize, _In_ BOOL bOrder, _In_ ULONG ulAf, _In_ TCP_TABLE_CLASS TableClass, _In_ ULONG Reserved)

Definition at line 57 of file netprv.c.

typedef DWORD(WINAPI * _GetExtendedUdpTable)(_Out_writes_bytes_opt_(*pdwSize) PVOID pUdpTable, _Inout_ PDWORD pdwSize, _In_ BOOL bOrder, _In_ ULONG ulAf, _In_ UDP_TABLE_CLASS TableClass, _In_ ULONG Reserved)

Definition at line 66 of file netprv.c.

typedef struct hostent* WSAAPI* _gethostbyaddr(_In_reads_bytes_(len) const char *addr, _In_ int len, _In_ int type)
read

Definition at line 92 of file netprv.c.

typedef INT(WSAAPI * _GetNameInfoW)(_In_reads_bytes_(SockaddrLength) const SOCKADDR *pSockaddr, _In_ socklen_t SockaddrLength, _Out_writes_opt_(NodeBufferSize) PWCHAR pNodeBuffer, _In_ DWORD NodeBufferSize, _Out_writes_opt_(ServiceBufferSize) PWCHAR pServiceBuffer, _In_ DWORD ServiceBufferSize, _In_ INT Flags)

Definition at line 82 of file netprv.c.

typedef int(WSAAPI * _WSAGetLastError)()

Definition at line 80 of file netprv.c.

typedef int(WSAAPI * _WSAStartup)(_In_ WORD wVersionRequested, _Out_ LPWSADATA lpWSAData)

Definition at line 75 of file netprv.c.

typedef struct _PH_NETWORK_CONNECTION PH_NETWORK_CONNECTION
typedef struct _PH_NETWORK_ITEM_QUERY_DATA PH_NETWORK_ITEM_QUERY_DATA
typedef struct _PHP_RESOLVE_CACHE_ITEM PHP_RESOLVE_CACHE_ITEM
typedef struct _PH_NETWORK_CONNECTION * PPH_NETWORK_CONNECTION
typedef struct _PH_NETWORK_ITEM_QUERY_DATA * PPH_NETWORK_ITEM_QUERY_DATA
typedef struct _PHP_RESOLVE_CACHE_ITEM * PPHP_RESOLVE_CACHE_ITEM

Function Documentation

PHAPPAPI PH_CALLBACK_DECLARE ( PhNetworkItemAddedEvent  )
PHAPPAPI PH_CALLBACK_DECLARE ( PhNetworkItemModifiedEvent  )
PHAPPAPI PH_CALLBACK_DECLARE ( PhNetworkItemRemovedEvent  )
PHAPPAPI PH_CALLBACK_DECLARE ( PhNetworkItemsUpdatedEvent  )
PPH_NETWORK_ITEM PhCreateNetworkItem ( VOID  )

Definition at line 177 of file netprv.c.

PPH_STRING PhGetHostNameFromAddress ( _In_ PPH_IP_ADDRESS  Address)

Definition at line 329 of file netprv.c.

BOOLEAN PhGetNetworkConnections ( _Out_ PPH_NETWORK_CONNECTION Connections,
_Out_ PULONG  NumberOfConnections 
)

Definition at line 843 of file netprv.c.

PWSTR PhGetProtocolTypeName ( _In_ ULONG  ProtocolType)

Definition at line 789 of file netprv.c.

PWSTR PhGetTcpStateName ( _In_ ULONG  State)

Definition at line 808 of file netprv.c.

BOOLEAN PhNetworkProviderInitialization ( VOID  )

Definition at line 153 of file netprv.c.

VOID PhNetworkProviderUpdate ( _In_ PVOID  Object)

Definition at line 508 of file netprv.c.

PPHP_RESOLVE_CACHE_ITEM PhpLookupResolveCacheItem ( _In_ PPH_IP_ADDRESS  Address)

Definition at line 307 of file netprv.c.

BOOLEAN PhpNetworkHashtableCompareFunction ( _In_ PVOID  Entry1,
_In_ PVOID  Entry2 
)

Definition at line 212 of file netprv.c.

ULONG NTAPI PhpNetworkHashtableHashFunction ( _In_ PVOID  Entry)

Definition at line 227 of file netprv.c.

VOID NTAPI PhpNetworkItemDeleteProcedure ( _In_ PVOID  Object,
_In_ ULONG  Flags 
)

Definition at line 193 of file netprv.c.

NTSTATUS PhpNetworkItemQueryWorker ( _In_ PVOID  Parameter)

Definition at line 402 of file netprv.c.

VOID PhpQueueNetworkItemQuery ( _In_ PPH_NETWORK_ITEM  NetworkItem,
_In_ BOOLEAN  Remote 
)

Definition at line 458 of file netprv.c.

VOID PhpRemoveNetworkItem ( _In_ PPH_NETWORK_ITEM  NetworkItem)

Definition at line 279 of file netprv.c.

BOOLEAN PhpResolveCacheHashtableCompareFunction ( _In_ PVOID  Entry1,
_In_ PVOID  Entry2 
)

Definition at line 287 of file netprv.c.

ULONG NTAPI PhpResolveCacheHashtableHashFunction ( _In_ PVOID  Entry)

Definition at line 298 of file netprv.c.

VOID PhpUpdateNetworkItemOwner ( _In_ PPH_NETWORK_ITEM  NetworkItem,
_In_ PPH_PROCESS_ITEM  ProcessItem 
)

Definition at line 489 of file netprv.c.

PPH_NETWORK_ITEM PhReferenceNetworkItem ( _In_ ULONG  ProtocolType,
_In_ PPH_IP_ENDPOINT  LocalEndpoint,
_In_ PPH_IP_ENDPOINT  RemoteEndpoint,
_In_ HANDLE  ProcessId 
)

Definition at line 240 of file netprv.c.

Variable Documentation

BOOLEAN PhEnableNetworkProviderResolve = TRUE

Definition at line 136 of file netprv.c.

PPH_HASHTABLE PhNetworkHashtable

Definition at line 128 of file netprv.c.

PH_QUEUED_LOCK PhNetworkHashtableLock = PH_QUEUED_LOCK_INIT

Definition at line 129 of file netprv.c.

SLIST_HEADER PhNetworkItemQueryListHead

Definition at line 140 of file netprv.c.

PPH_OBJECT_TYPE PhNetworkItemType

Definition at line 126 of file netprv.c.

PH_WORK_QUEUE PhNetworkProviderWorkQueue

Definition at line 139 of file netprv.c.

PH_INITONCE PhNetworkProviderWorkQueueInitOnce = PH_INITONCE_INIT

Definition at line 138 of file netprv.c.