NetworkTools: fixed typo;

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5447 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
dmex
2013-09-23 03:05:37 +00:00
parent ddee88daf9
commit cda3bc19b5
3 changed files with 21 additions and 16 deletions
+10 -5
View File
@@ -52,12 +52,18 @@ typedef enum _PH_NETWORK_ACTION
typedef struct _NETWORK_OUTPUT_CONTEXT
{
PH_NETWORK_ACTION Action;
PH_LAYOUT_MANAGER LayoutManager;
PH_GRAPH_STATE PingGraphState;
PH_CIRCULAR_BUFFER_ULONG64 PingHistory;
PH_CALLBACK_REGISTRATION ProcessesUpdatedRegistration;
HWND WindowHandle;
HWND PingGraphHandle;
HANDLE ThreadHandle;
HANDLE PipeReadHandle;
HANDLE ProcessHandle;
ULONG RemoteAddrType;
LONG64 CurrentPingMs;
LONG64 PingMinMs;
LONG64 PingMaxMs;
@@ -65,11 +71,10 @@ typedef struct _NETWORK_OUTPUT_CONTEXT
LONG64 PingSentCount;
LONG64 PingRecvCount;
LONG64 PingLossCount;
PPH_NETWORK_ITEM NetworkItem;
PH_LAYOUT_MANAGER LayoutManager;
PH_GRAPH_STATE PingGraphState;
PH_CALLBACK_REGISTRATION ProcessesUpdatedRegistration;
PH_CIRCULAR_BUFFER_ULONG64 PingHistory;
PH_IP_ADDRESS IpAddress;
PH_STRING_BUILDER ReceivedString;
WCHAR addressString[65];
} NETWORK_OUTPUT_CONTEXT, *PNETWORK_OUTPUT_CONTEXT;
+4 -4
View File
@@ -93,13 +93,13 @@ static INT_PTR CALLBACK NetworkOutputDlgProc(
PhLoadWindowPlacementFromSetting(L"ProcessHacker.NetTools.NetToolsWindowPosition", L"ProcessHacker.NetTools.NetToolsWindowSize", hwndDlg);
}
if (context->RemoteAddrType == PH_IPV4_NETWORK_TYPE)
if (context->IpAddress.Type == PH_IPV4_NETWORK_TYPE)
{
RtlIpv4AddressToString(&context->NetworkItem->RemoteEndpoint.Address.InAddr, context->addressString);
RtlIpv4AddressToString(&context->IpAddress.InAddr, context->addressString);
}
else
{
RtlIpv6AddressToString(&context->NetworkItem->RemoteEndpoint.Address.In6Addr, context->addressString);
RtlIpv6AddressToString(&context->IpAddress.In6Addr, context->addressString);
}
switch (context->Action)
@@ -342,7 +342,7 @@ VOID PerformNetworkAction(
context->Action = Action;
context->NetworkItem = NetworkItem;
context->RemoteAddrType = NetworkItem->RemoteEndpoint.Address.Type;
context->IpAddress = NetworkItem->RemoteEndpoint.Address;
if (context->Action == NETWORK_ACTION_PING)
{
+7 -7
View File
@@ -89,7 +89,7 @@ static NTSTATUS PhPingNetworkPingThreadStart(
if (context == NULL)
__leave;
if (context->RemoteAddrType == PH_IPV6_NETWORK_TYPE)
if (context->IpAddress.Type == PH_IPV6_NETWORK_TYPE)
{
SOCKADDR_IN6 icmp6LocalAddr = { 0 };
SOCKADDR_IN6 icmp6RemoteAddr = { 0 };
@@ -104,7 +104,7 @@ static NTSTATUS PhPingNetworkPingThreadStart(
icmp6LocalAddr.sin6_family = AF_INET6;
// Set Remote IPv6 address.
icmp6RemoteAddr.sin6_addr = context->NetworkItem->RemoteEndpoint.Address.In6Addr;
icmp6RemoteAddr.sin6_addr = context->IpAddress.In6Addr;
icmp6RemoteAddr.sin6_port = _byteswap_ushort((USHORT)context->NetworkItem->RemoteEndpoint.Port);
// Allocate ICMPv6 Ping buffer.
@@ -133,7 +133,7 @@ static NTSTATUS PhPingNetworkPingThreadStart(
icmp6ReplyStruct = (PICMPV6_ECHO_REPLY)icmpReplyBuffer;
if (icmpReplyCount > 0 && icmp6ReplyStruct)
{
//if (icmpReplyStruct->Address.sin6_addr == context->NetworkItem->RemoteEndpoint.Address.In6Addr)
//if (icmpReplyStruct->Address.sin6_addr == context->IpAddress.In6Addr)
//if (icmpReplyStruct->DataSize < max_size)
//if (icmpReplyStruct->RoundTripTime < 1)
@@ -159,7 +159,7 @@ static NTSTATUS PhPingNetworkPingThreadStart(
__leave;
// Set Remote IPv4 address.
icmpSourceAddr = context->NetworkItem->RemoteEndpoint.Address.InAddr.S_un.S_addr;
icmpSourceAddr = context->IpAddress.InAddr.S_un.S_addr;
// Allocate ICMPv4 Ping buffer.
icmpReplyLength = sizeof(ICMP_ECHO_REPLY);
@@ -338,17 +338,17 @@ static INT_PTR CALLBACK NetworkPingWndProc(
}
// Convert IP Address to string format.
if (context->RemoteAddrType == PH_IPV4_NETWORK_TYPE)
if (context->IpAddress.Type == PH_IPV4_NETWORK_TYPE)
{
RtlIpv4AddressToString(
&context->NetworkItem->RemoteEndpoint.Address.InAddr,
&context->IpAddress.InAddr,
context->addressString
);
}
else
{
RtlIpv6AddressToString(
&context->NetworkItem->RemoteEndpoint.Address.In6Addr,
&context->IpAddress.In6Addr,
context->addressString
);
}