Skip to content

Commit

Permalink
upd _app_formatip
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Dec 7, 2021
1 parent 22dbdca commit 58d0bd7
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ BOOLEAN _app_formatip (_In_ ADDRESS_FAMILY af, _In_ LPCVOID address, _Out_writes
{
PIN_ADDR p4addr;
PIN6_ADDR p6addr;
NTSTATUS status;

if (af == AF_INET)
{
Expand All @@ -306,7 +307,14 @@ BOOLEAN _app_formatip (_In_ ADDRESS_FAMILY af, _In_ LPCVOID address, _Out_writes
return FALSE;
}

if (NT_SUCCESS (RtlIpv4AddressToStringEx (p4addr, 0, buffer, &buffer_size)))
status = RtlIpv4AddressToStringEx (
p4addr,
0,
buffer,
&buffer_size
);

if (status == STATUS_SUCCESS)
return TRUE;
}
else if (af == AF_INET6)
Expand All @@ -319,7 +327,15 @@ BOOLEAN _app_formatip (_In_ ADDRESS_FAMILY af, _In_ LPCVOID address, _Out_writes
return FALSE;
}

if (NT_SUCCESS (RtlIpv6AddressToStringEx (p6addr, 0, 0, buffer, &buffer_size)))
status = RtlIpv6AddressToStringEx (
p6addr,
0,
0,
buffer,
&buffer_size
);

if (status == STATUS_SUCCESS)
return TRUE;
}

Expand Down

0 comments on commit 58d0bd7

Please sign in to comment.