mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[TCPIP] When enumerating sockets, retrieve their state and return it
This fixes netstat not having any state when enumerating connections. Basically, now, our netstat produces stuff like: https://twitter.com/HeisSpiter/status/1065871999266955264
This commit is contained in:
parent
738f327668
commit
91b013d387
2 changed files with 6 additions and 1 deletions
|
@ -216,3 +216,5 @@ VOID CompleteBucket(PCONNECTION_ENDPOINT Connection, PTDI_BUCKET Bucket, const B
|
||||||
|
|
||||||
void
|
void
|
||||||
LibTCPDumpPcb(PVOID SocketContext);
|
LibTCPDumpPcb(PVOID SocketContext);
|
||||||
|
|
||||||
|
NTSTATUS TCPGetSocketStatus(PCONNECTION_ENDPOINT Connection, PULONG State);
|
||||||
|
|
|
@ -188,7 +188,6 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
|
|
||||||
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
|
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
|
||||||
|
|
||||||
TcpRow.State = 0; /* FIXME */
|
|
||||||
TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
|
TcpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
|
||||||
TcpRow.dwLocalPort = AddrFile->Port;
|
TcpRow.dwLocalPort = AddrFile->Port;
|
||||||
|
|
||||||
|
@ -215,9 +214,13 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
|
||||||
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, (PULONG)&TcpRow.State);
|
||||||
|
ASSERT(NT_SUCCESS(Status));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
TcpRow.State = 0;
|
||||||
TcpRow.dwRemoteAddr = 0;
|
TcpRow.dwRemoteAddr = 0;
|
||||||
TcpRow.dwRemotePort = 0;
|
TcpRow.dwRemotePort = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue