mirror of
https://github.com/reactos/reactos.git
synced 2025-05-21 18:16:07 +00:00
[TCPIP] Properly display local information for established connections
This commit is contained in:
parent
41f991b1be
commit
0ec92100bc
1 changed files with 17 additions and 8 deletions
|
@ -190,8 +190,6 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
|
|
||||||
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
|
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
|
||||||
|
|
||||||
TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
|
|
||||||
TcpRow.dwLocalPort = AddrFile->Port;
|
|
||||||
TcpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
|
TcpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
|
||||||
if (Extended)
|
if (Extended)
|
||||||
{
|
{
|
||||||
|
@ -209,6 +207,8 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
EndPoint = AddrFile->Listener->AddressFile;
|
EndPoint = AddrFile->Listener->AddressFile;
|
||||||
|
|
||||||
TcpRow.dwState = MIB_TCP_STATE_LISTEN;
|
TcpRow.dwState = MIB_TCP_STATE_LISTEN;
|
||||||
|
TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
|
||||||
|
TcpRow.dwLocalPort = AddrFile->Port;
|
||||||
TcpRow.dwRemoteAddr = EndPoint->Address.Address.IPv4Address;
|
TcpRow.dwRemoteAddr = EndPoint->Address.Address.IPv4Address;
|
||||||
TcpRow.dwRemotePort = EndPoint->Port;
|
TcpRow.dwRemotePort = EndPoint->Port;
|
||||||
}
|
}
|
||||||
|
@ -217,6 +217,14 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
{
|
{
|
||||||
TA_IP_ADDRESS EndPoint;
|
TA_IP_ADDRESS EndPoint;
|
||||||
|
|
||||||
|
Status = TCPGetSockAddress(AddrFile->Connection, (PTRANSPORT_ADDRESS)&EndPoint, FALSE);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
ASSERT(EndPoint.TAAddressCount >= 1);
|
||||||
|
ASSERT(EndPoint.Address[0].AddressLength == TDI_ADDRESS_LENGTH_IP);
|
||||||
|
TcpRow.dwLocalAddr = EndPoint.Address[0].Address[0].in_addr;
|
||||||
|
TcpRow.dwLocalPort = ntohs(EndPoint.Address[0].Address[0].sin_port);
|
||||||
|
|
||||||
Status = TCPGetSockAddress(AddrFile->Connection, (PTRANSPORT_ADDRESS)&EndPoint, TRUE);
|
Status = TCPGetSockAddress(AddrFile->Connection, (PTRANSPORT_ADDRESS)&EndPoint, TRUE);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -224,11 +232,12 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
ASSERT(EndPoint.Address[0].AddressLength == TDI_ADDRESS_LENGTH_IP);
|
ASSERT(EndPoint.Address[0].AddressLength == TDI_ADDRESS_LENGTH_IP);
|
||||||
TcpRow.dwRemoteAddr = EndPoint.Address[0].Address[0].in_addr;
|
TcpRow.dwRemoteAddr = EndPoint.Address[0].Address[0].in_addr;
|
||||||
TcpRow.dwRemotePort = ntohs(EndPoint.Address[0].Address[0].sin_port);
|
TcpRow.dwRemotePort = ntohs(EndPoint.Address[0].Address[0].sin_port);
|
||||||
}
|
|
||||||
|
|
||||||
Status = TCPGetSocketStatus(AddrFile->Connection, &TcpRow.dwState);
|
Status = TCPGetSocketStatus(AddrFile->Connection, &TcpRow.dwState);
|
||||||
ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TcpRow.dwState = 0;
|
TcpRow.dwState = 0;
|
||||||
|
|
Loading…
Reference in a new issue