mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added check
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3120 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -80,6 +80,12 @@ typedef INT (WSAAPI *_GetNameInfoW)(
|
||||
__in INT Flags
|
||||
);
|
||||
|
||||
typedef struct hostent *(WSAAPI *_gethostbyaddr)(
|
||||
__in_bcount(len) const char *addr,
|
||||
__in int len,
|
||||
__in int type
|
||||
);
|
||||
|
||||
VOID NTAPI PhpNetworkItemDeleteProcedure(
|
||||
__in PVOID Object,
|
||||
__in ULONG Flags
|
||||
@@ -129,6 +135,7 @@ static PH_QUEUED_LOCK PhpResolveCacheHashtableLock = PH_QUEUED_LOCK_INIT;
|
||||
static _GetExtendedTcpTable GetExtendedTcpTable_I;
|
||||
static _GetExtendedUdpTable GetExtendedUdpTable_I;
|
||||
static _GetNameInfoW GetNameInfoW_I;
|
||||
static _gethostbyaddr gethostbyaddr_I;
|
||||
|
||||
BOOLEAN PhInitializeNetworkProvider()
|
||||
{
|
||||
@@ -327,6 +334,9 @@ PPH_STRING PhGetHostNameFromAddress(
|
||||
socklen_t length;
|
||||
PPH_STRING hostName;
|
||||
|
||||
if (!GetNameInfoW_I)
|
||||
return NULL;
|
||||
|
||||
if (Address->Type == PH_IPV4_NETWORK_TYPE)
|
||||
{
|
||||
ipv4Address.sin_family = AF_INET;
|
||||
@@ -377,6 +387,7 @@ PPH_STRING PhGetHostNameFromAddress(
|
||||
) != 0)
|
||||
{
|
||||
PhDereferenceObject(hostName);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -500,6 +511,7 @@ VOID PhNetworkProviderUpdate(
|
||||
GetExtendedUdpTable_I = PhGetProcAddress(L"iphlpapi.dll", "GetExtendedUdpTable");
|
||||
LoadLibrary(L"ws2_32.dll");
|
||||
GetNameInfoW_I = PhGetProcAddress(L"ws2_32.dll", "GetNameInfoW");
|
||||
gethostbyaddr_I = PhGetProcAddress(L"ws2_32.dll", "gethostbyaddr");
|
||||
}
|
||||
|
||||
if (!PhGetNetworkConnections(&connections, &numberOfConnections))
|
||||
|
||||
@@ -23,6 +23,7 @@ typedef struct _PH_IP_ADDRESS
|
||||
ULONG Type;
|
||||
union
|
||||
{
|
||||
ULONG Address[4];
|
||||
ULONG Ipv4;
|
||||
struct in_addr InAddr;
|
||||
UCHAR Ipv6[16];
|
||||
|
||||
Reference in New Issue
Block a user