https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f718b1d71907301ca893e…
commit f718b1d71907301ca893e41195975932aa0b9940
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Tue Nov 27 22:27:45 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Tue Nov 27 23:12:56 2018 +0100
[TCPIP] Stubplement returning module information for TCP and UDP connections
---
drivers/network/tcpip/tcpip/info.c | 17 +++++++++++++++++
drivers/network/tcpip/tcpip/ninfo.c | 31 ++++++++++++++++++++++++++-----
2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/drivers/network/tcpip/tcpip/info.c b/drivers/network/tcpip/tcpip/info.c
index 674fb96049..6cc44d5985 100644
--- a/drivers/network/tcpip/tcpip/info.c
+++ b/drivers/network/tcpip/tcpip/info.c
@@ -308,6 +308,23 @@ TDI_STATUS InfoTdiQueryInformationEx(
else
return TDI_INVALID_PARAMETER;
+ case IP_SPECIFIC_MODULE_ENTRY_ID:
+ if (ID->toi_type != INFO_TYPE_PROVIDER)
+ return TDI_INVALID_PARAMETER;
+
+ if (ID->toi_entity.tei_entity == CO_TL_ENTITY)
+ if ((EntityListContext = GetContext(ID->toi_entity)))
+ return InfoTdiQueryGetConnectionTcpTable(EntityListContext,
Buffer, BufferSize, TcpUdpClassOwner);
+ else
+ return TDI_INVALID_PARAMETER;
+ else if (ID->toi_entity.tei_entity == CL_TL_ENTITY)
+ if ((EntityListContext = GetContext(ID->toi_entity)))
+ return InfoTdiQueryGetConnectionUdpTable(EntityListContext,
Buffer, BufferSize, TcpUdpClassOwner);
+ else
+ return TDI_INVALID_PARAMETER;
+ else
+ return TDI_INVALID_PARAMETER;
+
#if 0
case IP_INTFC_INFO_ID:
if (ID->toi_type != INFO_TYPE_PROVIDER)
diff --git a/drivers/network/tcpip/tcpip/ninfo.c b/drivers/network/tcpip/tcpip/ninfo.c
index 267c43f1d9..3df5204d42 100644
--- a/drivers/network/tcpip/tcpip/ninfo.c
+++ b/drivers/network/tcpip/tcpip/ninfo.c
@@ -185,22 +185,27 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE
AddrFile,
TDI_TCPUDP_CLASS_INFO Class)
{
SIZE_T Size;
- MIB_TCPROW_OWNER_PID TcpRow;
+ MIB_TCPROW_OWNER_MODULE TcpRow;
TDI_STATUS Status = TDI_INVALID_REQUEST;
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
- TcpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
if (Class == TcpUdpClassOwnerPid)
{
Size = sizeof(MIB_TCPROW_OWNER_PID);
}
+ else if (Class == TcpUdpClassOwner)
+ {
+ Size = sizeof(MIB_TCPROW_OWNER_MODULE);
+ }
else
{
- ASSERT(Class != TcpUdpClassOwner);
Size = sizeof(MIB_TCPROW);
}
+ TcpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
+ TcpRow.liCreateTimestamp = AddrFile->CreationTime; /* FIXME: to check */
+
if (AddrFile->Listener != NULL)
{
PADDRESS_FILE EndPoint;
@@ -244,6 +249,12 @@ TDI_STATUS InfoTdiQueryGetConnectionTcpTable(PADDRESS_FILE AddrFile,
if (NT_SUCCESS(Status))
{
+ if (Class == TcpUdpClassOwner)
+ {
+ /* FIXME */
+ RtlZeroMemory(&TcpRow.OwningModuleInfo[0],
sizeof(TcpRow.OwningModuleInfo));
+ }
+
Status = InfoCopyOut( (PCHAR)&TcpRow, Size,
Buffer, BufferSize );
}
@@ -259,7 +270,7 @@ TDI_STATUS InfoTdiQueryGetConnectionUdpTable(PADDRESS_FILE AddrFile,
TDI_TCPUDP_CLASS_INFO Class)
{
SIZE_T Size;
- MIB_UDPROW_OWNER_PID UdpRow;
+ MIB_UDPROW_OWNER_MODULE UdpRow;
TDI_STATUS Status = TDI_INVALID_REQUEST;
TI_DbgPrint(DEBUG_INFO, ("Called.\n"));
@@ -268,15 +279,25 @@ TDI_STATUS InfoTdiQueryGetConnectionUdpTable(PADDRESS_FILE
AddrFile,
{
Size = sizeof(MIB_UDPROW_OWNER_PID);
}
+ else if (Class == TcpUdpClassOwner)
+ {
+ Size = sizeof(MIB_UDPROW_OWNER_MODULE);
+ }
else
{
- ASSERT(Class != TcpUdpClassOwner);
Size = sizeof(MIB_UDPROW);
}
UdpRow.dwLocalAddr = AddrFile->Address.Address.IPv4Address;
UdpRow.dwLocalPort = AddrFile->Port;
UdpRow.dwOwningPid = (DWORD)AddrFile->ProcessId;
+ UdpRow.liCreateTimestamp = AddrFile->CreationTime; /* FIXME: to check */
+ UdpRow.dwFlags = 0; /* FIXME */
+ if (Class == TcpUdpClassOwner)
+ {
+ /* FIXME */
+ RtlZeroMemory(&UdpRow.OwningModuleInfo[0], sizeof(UdpRow.OwningModuleInfo));
+ }
Status = InfoCopyOut( (PCHAR)&UdpRow,
Size, Buffer, BufferSize );