https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5360f542f5b26616673a…
commit a5360f542f5b26616673a193c906f808160f29e9
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Mon Jul 3 00:38:41 2023 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Mon Jul 3 00:38:41 2023 +0200
[IPHLPAPI] Formatting only, no functional change
- Strip inconsistent spaces from the spec file.
- iphlpapi_main: Harmonize inconsistent and line-wasting function-comments and fix
mixed space-tab-indentation.
- ipstats_reactos.c: Compactify horizontally accordingly to the coding guidelines
I am interested in that code for a backport, so I want it to be well-formatted.
Ftr: IPHLPAPI was *forked* more than a decade ago from Wine.
Therefore no diff ever was guarded within those files whenever we implemented anything
here.
---
dll/win32/iphlpapi/iphlpapi.spec | 118 +++++-----
dll/win32/iphlpapi/iphlpapi_main.c | 205 +---------------
dll/win32/iphlpapi/ipstats_reactos.c | 443 +++++++++++++++++------------------
3 files changed, 284 insertions(+), 482 deletions(-)
diff --git a/dll/win32/iphlpapi/iphlpapi.spec b/dll/win32/iphlpapi/iphlpapi.spec
index 3151b5f40db..ea7d71a0fd5 100644
--- a/dll/win32/iphlpapi/iphlpapi.spec
+++ b/dll/win32/iphlpapi/iphlpapi.spec
@@ -1,84 +1,84 @@
-@ stdcall AddIPAddress( long long long ptr ptr )
+@ stdcall AddIPAddress(long long long ptr ptr)
@ stub AllocateAndGetArpEntTableFromStack
-@ stdcall AllocateAndGetIfTableFromStack( ptr long long long )
-@ stdcall AllocateAndGetIpAddrTableFromStack( ptr long long long )
-@ stdcall AllocateAndGetIpForwardTableFromStack( ptr long long long )
-@ stdcall AllocateAndGetIpNetTableFromStack( ptr long long long )
-@ stdcall AllocateAndGetTcpExTable2FromStack( ptr long long long long long )
-@ stdcall AllocateAndGetTcpExTableFromStack( ptr long long long long )
-@ stdcall AllocateAndGetTcpTableFromStack( ptr long long long )
-@ stdcall AllocateAndGetUdpExTable2FromStack( ptr long long long long long )
-@ stdcall AllocateAndGetUdpExTableFromStack( ptr long long long long )
-@ stdcall AllocateAndGetUdpTableFromStack( ptr long long long )
+@ stdcall AllocateAndGetIfTableFromStack(ptr long long long)
+@ stdcall AllocateAndGetIpAddrTableFromStack(ptr long long long)
+@ stdcall AllocateAndGetIpForwardTableFromStack(ptr long long long)
+@ stdcall AllocateAndGetIpNetTableFromStack(ptr long long long)
+@ stdcall AllocateAndGetTcpExTable2FromStack(ptr long long long long long)
+@ stdcall AllocateAndGetTcpExTableFromStack(ptr long long long long)
+@ stdcall AllocateAndGetTcpTableFromStack(ptr long long long)
+@ stdcall AllocateAndGetUdpExTable2FromStack(ptr long long long long long)
+@ stdcall AllocateAndGetUdpExTableFromStack(ptr long long long long)
+@ stdcall AllocateAndGetUdpTableFromStack(ptr long long long)
@ stdcall CancelIPChangeNotify(ptr)
@ stub CancelSecurityHealthChangeNotify
-@ stdcall CreateIpForwardEntry( ptr )
-@ stdcall CreateIpNetEntry( ptr )
-@ stdcall CreateProxyArpEntry( long long long )
-@ stdcall DeleteIPAddress( long )
-@ stdcall DeleteIpForwardEntry( ptr )
-@ stdcall DeleteIpNetEntry( ptr )
-@ stdcall DeleteProxyArpEntry( long long long )
+@ stdcall CreateIpForwardEntry(ptr)
+@ stdcall CreateIpNetEntry(ptr)
+@ stdcall CreateProxyArpEntry(long long long)
+@ stdcall DeleteIPAddress(long)
+@ stdcall DeleteIpForwardEntry(ptr)
+@ stdcall DeleteIpNetEntry(ptr)
+@ stdcall DeleteProxyArpEntry(long long long)
@ stdcall DisableMediaSense(ptr ptr)
-@ stdcall EnableRouter( ptr ptr )
-@ stdcall FlushIpNetTable( long )
+@ stdcall EnableRouter(ptr ptr)
+@ stdcall FlushIpNetTable(long)
@ stub FlushIpNetTableFromStack
-@ stdcall GetAdapterIndex( wstr ptr )
+@ stdcall GetAdapterIndex(wstr ptr)
@ stdcall GetAdapterOrderMap()
-@ stdcall GetAdaptersAddresses( long long ptr ptr ptr )
-@ stdcall GetAdaptersInfo( ptr ptr )
-@ stdcall GetBestInterface( long ptr )
+@ stdcall GetAdaptersAddresses(long long ptr ptr ptr)
+@ stdcall GetAdaptersInfo(ptr ptr)
+@ stdcall GetBestInterface(long ptr)
@ stdcall GetBestInterfaceEx(ptr ptr)
@ stub GetBestInterfaceFromStack
-@ stdcall GetBestRoute( long long long )
+@ stdcall GetBestRoute(long long long)
@ stub GetBestRouteFromStack
-@ stdcall GetExtendedTcpTable( ptr ptr long long long long )
-@ stdcall GetExtendedUdpTable( ptr ptr long long long long )
-@ stdcall GetFriendlyIfIndex( long )
-@ stdcall GetIcmpStatistics( ptr )
+@ stdcall GetExtendedTcpTable(ptr ptr long long long long)
+@ stdcall GetExtendedUdpTable(ptr ptr long long long long)
+@ stdcall GetFriendlyIfIndex(long)
+@ stdcall GetIcmpStatistics(ptr)
@ stdcall GetIcmpStatisticsEx(ptr long)
@ stub GetIcmpStatsFromStack
@ stub GetIcmpStatsFromStackEx
-@ stdcall GetIfEntry( ptr )
+@ stdcall GetIfEntry(ptr)
@ stub GetIfEntryFromStack
-@ stdcall GetIfTable( ptr ptr long )
+@ stdcall GetIfTable(ptr ptr long)
@ stub GetIfTableFromStack
@ stub GetIgmpList
-@ stdcall GetInterfaceInfo( ptr ptr )
-@ stdcall GetIpAddrTable( ptr ptr long )
+@ stdcall GetInterfaceInfo(ptr ptr)
+@ stdcall GetIpAddrTable(ptr ptr long)
@ stub GetIpAddrTableFromStack
@ stdcall GetIpErrorString(long ptr ptr)
-@ stdcall GetIpForwardTable( ptr ptr long )
+@ stdcall GetIpForwardTable(ptr ptr long)
@ stub GetIpForwardTableFromStack
-@ stdcall GetIpNetTable( ptr ptr long )
+@ stdcall GetIpNetTable(ptr ptr long)
@ stub GetIpNetTableFromStack
-@ stdcall GetIpStatistics( ptr )
+@ stdcall GetIpStatistics(ptr)
@ stdcall GetIpStatisticsEx(ptr long)
@ stub GetIpStatsFromStack
@ stub GetIpStatsFromStackEx
-@ stdcall GetNetworkParams( ptr ptr )
-@ stdcall GetNumberOfInterfaces( ptr )
+@ stdcall GetNetworkParams(ptr ptr)
+@ stdcall GetNumberOfInterfaces(ptr)
@ stub GetOwnerModuleFromTcp6Entry
-@ stdcall GetOwnerModuleFromTcpEntry ( ptr long ptr ptr )
+@ stdcall GetOwnerModuleFromTcpEntry(ptr long ptr ptr)
@ stub GetOwnerModuleFromUdp6Entry
-@ stdcall GetOwnerModuleFromUdpEntry ( ptr long ptr ptr )
-@ stdcall GetPerAdapterInfo( long ptr ptr )
-@ stdcall GetRTTAndHopCount( long ptr long ptr )
+@ stdcall GetOwnerModuleFromUdpEntry(ptr long ptr ptr)
+@ stdcall GetPerAdapterInfo(long ptr ptr)
+@ stdcall GetRTTAndHopCount(long ptr long ptr)
@ stub GetTcpExTable2FromStack
-@ stdcall GetTcpStatistics( ptr )
+@ stdcall GetTcpStatistics(ptr)
@ stdcall GetTcpStatisticsEx(ptr long)
@ stub GetTcpStatsFromStack
@ stub GetTcpStatsFromStackEx
-@ stdcall GetTcpTable( ptr ptr long )
+@ stdcall GetTcpTable(ptr ptr long)
@ stub GetTcpTableFromStack
@ stub GetUdpExTable2FromStack
-@ stdcall GetUdpStatistics( ptr )
+@ stdcall GetUdpStatistics(ptr)
@ stdcall GetUdpStatisticsEx(ptr long)
@ stub GetUdpStatsFromStack
@ stub GetUdpStatsFromStackEx
-@ stdcall GetUdpTable( ptr ptr long )
+@ stdcall GetUdpTable(ptr ptr long)
@ stub GetUdpTableFromStack
-@ stdcall GetUniDirectionalAdapterInfo( ptr ptr )
+@ stdcall GetUniDirectionalAdapterInfo(ptr ptr)
@ stdcall Icmp6CreateFile()
@ stdcall Icmp6ParseReplies(ptr long)
@ stdcall Icmp6SendEcho2(ptr ptr ptr ptr ptr ptr ptr long ptr ptr long long)
@@ -102,8 +102,8 @@
@ stub InternalSetIpNetEntry
@ stub InternalSetIpStats
@ stub InternalSetTcpEntry
-@ stdcall IpReleaseAddress( ptr )
-@ stdcall IpRenewAddress( ptr )
+@ stdcall IpReleaseAddress(ptr)
+@ stdcall IpRenewAddress(ptr)
@ stub IsLocalAddress
@ stub NTPTimeToNTFileTime
@ stub NTTimeToNTPTime
@@ -112,8 +112,8 @@
@ stdcall NhGetInterfaceNameFromGuid(ptr ptr ptr long long)
@ stdcall NhpAllocateAndGetInterfaceInfoFromStack(ptr ptr long ptr long)
@ stub NhpGetInterfaceIndexFromStack
-@ stdcall NotifyAddrChange( ptr ptr )
-@ stdcall NotifyRouteChange( ptr ptr )
+@ stdcall NotifyAddrChange(ptr ptr)
+@ stdcall NotifyRouteChange(ptr ptr)
@ stub NotifyRouteChangeEx
@ stub NotifySecurityHealthChange
@ stdcall _PfAddFiltersToInterface@24()
@@ -136,22 +136,22 @@
@ stdcall SendARP(long long ptr ptr)
@ stub SetAdapterIpAddress
@ stub SetBlockRoutes
-@ stdcall SetIfEntry( ptr )
+@ stdcall SetIfEntry(ptr)
@ stub SetIfEntryToStack
-@ stdcall SetIpForwardEntry( ptr )
-@ stdcall SetIpForwardEntryToStack( ptr )
+@ stdcall SetIpForwardEntry(ptr)
+@ stdcall SetIpForwardEntryToStack(ptr)
@ stub SetIpMultihopRouteEntryToStack
-@ stdcall SetIpNetEntry( ptr )
+@ stdcall SetIpNetEntry(ptr)
@ stub SetIpNetEntryToStack
@ stub SetIpRouteEntryToStack
-@ stdcall SetIpStatistics( ptr )
+@ stdcall SetIpStatistics(ptr)
@ stub SetIpStatsToStack
-@ stdcall SetIpTTL( long )
+@ stdcall SetIpTTL(long)
@ stub SetProxyArpEntryToStack
@ stub SetRouteWithRef
-@ stdcall SetTcpEntry( ptr )
+@ stdcall SetTcpEntry(ptr)
@ stub SetTcpEntryToStack
-@ stdcall UnenableRouter( ptr ptr )
+@ stdcall UnenableRouter(ptr ptr)
@ stub do_echo_rep
@ stub do_echo_req
@ stub register_icmp
diff --git a/dll/win32/iphlpapi/iphlpapi_main.c b/dll/win32/iphlpapi/iphlpapi_main.c
index 377a1cbaa80..a2fccb2cf58 100644
--- a/dll/win32/iphlpapi/iphlpapi_main.c
+++ b/dll/win32/iphlpapi/iphlpapi_main.c
@@ -54,9 +54,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
lpvReserved)
/******************************************************************
* AddIPAddress (IPHLPAPI.@)
*
- *
* PARAMS
- *
* Address [In]
* IpMask [In]
* IfIndex [In]
@@ -64,9 +62,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
lpvReserved)
* NTEInstance [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex, PULONG
NteContext, PULONG NteInstance)
{
@@ -75,9 +71,9 @@ DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex,
PULONG
DWORD getInterfaceGatewayByIndex(DWORD index)
{
- DWORD ndx, retVal = 0, numRoutes = getNumRoutes();
- RouteTable *table = getRouteTable();
- if (!table) return 0;
+ DWORD ndx, retVal = 0, numRoutes = getNumRoutes();
+ RouteTable *table = getRouteTable();
+ if (!table) return 0;
for (ndx = 0; ndx < numRoutes; ndx++)
{
@@ -91,9 +87,7 @@ DWORD getInterfaceGatewayByIndex(DWORD index)
/******************************************************************
* AllocateAndGetIfTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppIfTable [Out] -- pointer into which the MIB_IFTABLE is
* allocated and returned.
* bOrder [In] -- passed to GetIfTable to order the table
@@ -102,7 +96,6 @@ DWORD getInterfaceGatewayByIndex(DWORD index)
*
* RETURNS -- ERROR_INVALID_PARAMETER if ppIfTable is NULL, whatever
* GetIfTable returns otherwise
- *
*/
DWORD WINAPI AllocateAndGetIfTableFromStack(PMIB_IFTABLE *ppIfTable,
BOOL bOrder, HANDLE heap, DWORD flags)
@@ -135,18 +128,14 @@ DWORD WINAPI AllocateAndGetIfTableFromStack(PMIB_IFTABLE
*ppIfTable,
/******************************************************************
* AllocateAndGetIpAddrTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppIpAddrTable [Out]
* bOrder [In] -- passed to GetIpAddrTable to order the table
* heap [In] -- heap from which the table is allocated
* flags [In] -- flags to HeapAlloc
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable,
BOOL bOrder, HANDLE heap, DWORD flags)
@@ -179,7 +168,6 @@ DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE
*ppIpAddrTable,
/******************************************************************
* AllocateAndGetIpForwardTableFromStack (IPHLPAPI.@)
*
- *
* ppIpForwardTable [Out] -- pointer into which the MIB_IPFORWARDTABLE is
* allocated and returned.
* bOrder [In] -- passed to GetIfTable to order the table
@@ -188,7 +176,6 @@ DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE
*ppIpAddrTable,
*
* RETURNS -- ERROR_INVALID_PARAMETER if ppIfTable is NULL, whatever
* GetIpForwardTable returns otherwise
- *
*/
DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *
ppIpForwardTable, BOOL bOrder, HANDLE heap, DWORD flags)
@@ -221,18 +208,14 @@ DWORD WINAPI
AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *
/******************************************************************
* AllocateAndGetIpNetTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppIpNetTable [Out]
* bOrder [In] -- passed to GetIpNetTable to order the table
* heap [In] -- heap from which the table is allocated
* flags [In] -- flags to HeapAlloc
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable,
BOOL bOrder, HANDLE heap, DWORD flags)
@@ -265,18 +248,14 @@ DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE
*ppIpNetTable,
/******************************************************************
* AllocateAndGetTcpTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppTcpTable [Out]
* bOrder [In] -- passed to GetTcpTable to order the table
* heap [In] -- heap from which the table is allocated
* flags [In] -- flags to HeapAlloc
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable,
BOOL bOrder, HANDLE heap, DWORD flags)
@@ -309,9 +288,7 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE
*ppTcpTable,
/******************************************************************
* AllocateAndGetTcpExTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppTcpTable [Out]
* bOrder [In] -- passed to GetExtendedTcpTable to order the table
* heap [In] -- heap from which the table is allocated
@@ -319,9 +296,7 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE
*ppTcpTable,
* family [In] -- passed to GetExtendedTcpTable to select INET family
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetTcpExTableFromStack(PVOID *ppTcpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family)
@@ -354,9 +329,7 @@ DWORD WINAPI AllocateAndGetTcpExTableFromStack(PVOID *ppTcpTable,
/******************************************************************
* AllocateAndGetTcpExTable2FromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppTcpTable [Out]
* bOrder [In] -- passed to GetExtendedTcpTable to order the table
* heap [In] -- heap from which the table is allocated
@@ -365,9 +338,7 @@ DWORD WINAPI AllocateAndGetTcpExTableFromStack(PVOID *ppTcpTable,
* class [In] -- passed to GetExtendedTcpTable to select information
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetTcpExTable2FromStack(PVOID *ppTcpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family, TCP_TABLE_CLASS class)
@@ -400,18 +371,14 @@ DWORD WINAPI AllocateAndGetTcpExTable2FromStack(PVOID *ppTcpTable,
/******************************************************************
* AllocateAndGetUdpTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppUdpTable [Out]
* bOrder [In] -- passed to GetUdpTable to order the table
* heap [In] -- heap from which the table is allocated
* flags [In] -- flags to HeapAlloc
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable,
BOOL bOrder, HANDLE heap, DWORD flags)
@@ -444,9 +411,7 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE
*ppUdpTable,
/******************************************************************
* AllocateAndGetUdpExTableFromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppUdpTable [Out]
* bOrder [In] -- passed to GetExtendedUdpTable to order the table
* heap [In] -- heap from which the table is allocated
@@ -454,9 +419,7 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE
*ppUdpTable,
* family [In] -- passed to GetExtendedUdpTable to select INET family
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetUdpExTableFromStack(PVOID *ppUdpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family)
@@ -489,9 +452,7 @@ DWORD WINAPI AllocateAndGetUdpExTableFromStack(PVOID *ppUdpTable,
/******************************************************************
* AllocateAndGetUdpExTable2FromStack (IPHLPAPI.@)
*
- *
* PARAMS
- *
* ppUdpTable [Out]
* bOrder [In] -- passed to GetExtendedUdpTable to order the table
* heap [In] -- heap from which the table is allocated
@@ -500,9 +461,7 @@ DWORD WINAPI AllocateAndGetUdpExTableFromStack(PVOID *ppUdpTable,
* class [In] -- passed to GetExtendedUdpTable to select information
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI AllocateAndGetUdpExTable2FromStack(PVOID *ppUdpTable,
BOOL bOrder, HANDLE heap, DWORD flags, DWORD family, UDP_TABLE_CLASS class)
@@ -535,15 +494,11 @@ DWORD WINAPI AllocateAndGetUdpExTable2FromStack(PVOID *ppUdpTable,
/******************************************************************
* CreateIpForwardEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pRoute [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
{
@@ -554,15 +509,11 @@ DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
/******************************************************************
* CreateIpNetEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pArpEntry [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
{
@@ -576,17 +527,13 @@ DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
/******************************************************************
* CreateProxyArpEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* dwAddress [In]
* dwMask [In]
* dwIfIndex [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
{
@@ -601,15 +548,11 @@ DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask,
DWORD dwIfIndex)
/******************************************************************
* DeleteIPAddress (IPHLPAPI.@)
*
- *
* PARAMS
- *
* NTEContext [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
{
@@ -621,15 +564,11 @@ DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
/******************************************************************
* DeleteIpForwardEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pRoute [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
{
@@ -640,15 +579,11 @@ DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
/******************************************************************
* DeleteIpNetEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pArpEntry [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
{
@@ -662,17 +597,13 @@ DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
/******************************************************************
* DeleteProxyArpEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* dwAddress [In]
* dwMask [In]
* dwIfIndex [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
{
@@ -686,16 +617,12 @@ DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask,
DWORD dwIfIndex)
/******************************************************************
* EnableRouter (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pHandle [In/Out]
* pOverlapped [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI EnableRouter(HANDLE * pHandle, OVERLAPPED * pOverlapped)
{
@@ -711,15 +638,11 @@ DWORD WINAPI EnableRouter(HANDLE * pHandle, OVERLAPPED *
pOverlapped)
/******************************************************************
* FlushIpNetTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* dwIfIndex [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
{
@@ -734,16 +657,12 @@ DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
/******************************************************************
* GetAdapterIndex (IPHLPAPI.@)
*
- *
* PARAMS
- *
* AdapterName [In/Out]
* IfIndex [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
{
@@ -757,16 +676,12 @@ DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
/******************************************************************
* GetAdaptersInfo (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pAdapterInfo [In/Out]
* pOutBufLen [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
{
@@ -826,7 +741,7 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG
pOutBufLen)
winsEnabled = TRUE;
RegCloseKey(hKey);
}
- TRACE("num of index is %lu\n", table->numIndexes);
+ TRACE("num of index is %lu\n", table->numIndexes);
for (ndx = 0; ndx < table->numIndexes; ndx++) {
PIP_ADAPTER_INFO ptr = &pAdapterInfo[ndx];
DWORD addrLen = sizeof(ptr->Address), type;
@@ -893,16 +808,12 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG
pOutBufLen)
/******************************************************************
* GetBestInterface (IPHLPAPI.@)
*
- *
* PARAMS
- *
* dwDestAddr [In]
* pdwBestIfIndex [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
{
@@ -926,17 +837,13 @@ DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD
pdwBestIfIndex)
/******************************************************************
* GetBestRoute (IPHLPAPI.@)
*
- *
* PARAMS
- *
* dwDestAddr [In]
* dwSourceAddr [In]
* OUT [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW
pBestRoute)
{
@@ -1015,10 +922,7 @@ static int TcpTableSorter(const void *a, const void *b)
* RETURNS
* Success: NO_ERROR
* Failure: either ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER
- *
- * NOTES
*/
-
DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, ULONG
ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved)
{
DWORD i, count, size;
@@ -1402,7 +1306,6 @@ DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize,
BOOL bOrder, U
return ret;
}
-
static int UdpTableSorter(const void *a, const void *b)
{
int ret;
@@ -1435,14 +1338,11 @@ static int UdpTableSorter(const void *a, const void *b)
* RETURNS
* Success: NO_ERROR
* Failure: either ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER
- *
- * NOTES
*/
-
DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize, BOOL bOrder, ULONG
ulAf, UDP_TABLE_CLASS TableClass, ULONG Reserved)
{
DWORD size;
- DWORD ret = NO_ERROR;
+ DWORD ret = NO_ERROR;
if (!pdwSize)
{
@@ -1550,15 +1450,11 @@ DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize,
BOOL bOrder, U
/******************************************************************
* GetFriendlyIfIndex (IPHLPAPI.@)
*
- *
* PARAMS
- *
* IfIndex [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
{
@@ -1573,15 +1469,11 @@ DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
/******************************************************************
* GetIcmpStatistics (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
{
@@ -1597,15 +1489,11 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
/******************************************************************
* GetIfEntry (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIfRow [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
{
@@ -1645,17 +1533,13 @@ static int IfTableSorter(const void *a, const void *b)
/******************************************************************
* GetIfTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIfTable [In/Out]
* pdwSize [In/Out]
* bOrder [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
{
@@ -1713,16 +1597,12 @@ DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize,
BOOL bOrder)
/******************************************************************
* GetInterfaceInfo (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIfTable [In/Out]
* dwOutBufLen [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen)
{
@@ -1801,17 +1681,13 @@ static int IpAddrTableSorter(const void *a, const void *b)
/******************************************************************
* GetIpAddrTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIpAddrTable [In/Out]
* pdwSize [In/Out]
* bOrder [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
{
@@ -1905,17 +1781,13 @@ static int IpForwardTableSorter(const void *a, const void *b)
/******************************************************************
* GetIpForwardTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIpForwardTable [In/Out]
* pdwSize [In/Out]
* bOrder [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL
bOrder)
{
@@ -2005,17 +1877,13 @@ static int IpNetTableSorter(const void *a, const void *b)
/******************************************************************
* GetIpNetTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pIpNetTable [In/Out]
* pdwSize [In/Out]
* bOrder [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
{
@@ -2065,15 +1933,11 @@ DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG
pdwSize, BOOL bOr
/******************************************************************
* GetIpStatistics (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
{
@@ -2083,16 +1947,12 @@ DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
/******************************************************************
* GetIpStatisticsEx (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
* dwFamily [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS pStats, DWORD dwFamily)
{
@@ -2107,16 +1967,12 @@ DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS pStats, DWORD
dwFamily)
/******************************************************************
* GetNetworkParams (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pFixedInfo [In/Out]
* pOutBufLen [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
{
@@ -2260,15 +2116,11 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG
pOutBufLen)
/******************************************************************
* GetNumberOfInterfaces (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pdwNumIf [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
{
@@ -2466,7 +2318,7 @@ static DWORD GetOwnerModuleFromTagEntry(DWORD OwningPid, DWORD
OwningTag, TCPIP_
* NOTES
* The type of data returned in Buffer is indicated by the value of the Class parameter.
*/
-DWORD WINAPI GetOwnerModuleFromTcpEntry( PMIB_TCPROW_OWNER_MODULE pTcpEntry,
TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
+DWORD WINAPI GetOwnerModuleFromTcpEntry(PMIB_TCPROW_OWNER_MODULE pTcpEntry,
TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
{
/* If we have a service tag, that's a service connection */
if (pTcpEntry->OwningModuleInfo[0] != 0)
@@ -2498,7 +2350,7 @@ DWORD WINAPI GetOwnerModuleFromTcpEntry( PMIB_TCPROW_OWNER_MODULE
pTcpEntry, TCP
* NOTES
* The type of data returned in Buffer is indicated by the value of the Class parameter.
*/
-DWORD WINAPI GetOwnerModuleFromUdpEntry( PMIB_UDPROW_OWNER_MODULE pUdpEntry,
TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
+DWORD WINAPI GetOwnerModuleFromUdpEntry(PMIB_UDPROW_OWNER_MODULE pUdpEntry,
TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
{
/* If we have a service tag, that's a service connection */
if (pUdpEntry->OwningModuleInfo[0] != 0)
@@ -2544,17 +2396,13 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface,
PWCHAR Server,
/******************************************************************
* GetPerAdapterInfo (IPHLPAPI.@)
*
- *
* PARAMS
- *
* IfIndex [In]
* pPerAdapterInfo [In/Out]
* pOutBufLen [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo,
PULONG pOutBufLen)
{
@@ -2618,18 +2466,14 @@ DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO
pPerAdapterIn
/******************************************************************
* GetRTTAndHopCount (IPHLPAPI.@)
*
- *
* PARAMS
- *
* DestIpAddress [In]
* HopCount [In/Out]
* MaxHops [In]
* RTT [In/Out]
*
* RETURNS
- *
* BOOL
- *
*/
BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops,
PULONG RTT)
{
@@ -2643,16 +2487,12 @@ BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG
HopCount, ULONG MaxHo
/******************************************************************
* GetTcpStatisticsEx (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
* dwFamily [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetTcpStatisticsEx(PMIB_TCPSTATS pStats, DWORD dwFamily)
{
@@ -2667,15 +2507,11 @@ DWORD WINAPI GetTcpStatisticsEx(PMIB_TCPSTATS pStats, DWORD
dwFamily)
/******************************************************************
* GetTcpStatistics (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
{
@@ -2707,23 +2543,19 @@ DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
*/
DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
{
- return GetExtendedTcpTable(pTcpTable, pdwSize, bOrder, AF_INET, TCP_TABLE_BASIC_ALL,
0);
+ return GetExtendedTcpTable(pTcpTable, pdwSize, bOrder, AF_INET, TCP_TABLE_BASIC_ALL,
0);
}
/******************************************************************
* GetUdpStatisticsEx (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
* dwFamily [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS pStats, DWORD dwFamily)
{
@@ -2738,15 +2570,11 @@ DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS pStats, DWORD
dwFamily)
/******************************************************************
* GetUdpStatistics (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pStats [In/Out]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
{
@@ -2757,21 +2585,17 @@ DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
/******************************************************************
* GetUdpTable (IPHLPAPI.@)
*
- *
* PARAMS
- *
* pUdpTable [In/Out]
* pdwSize [In/Out]
* bOrder [In]
*
* RETURNS
- *
* DWORD
- *
*/
DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
{
- return GetExtendedUdpTable(pUdpTable, pdwSize, bOrder, AF_INET, UDP_TABLE_BASIC, 0);
+ return GetExtendedUdpTable(pUdpTable, pdwSize, bOrder, AF_INET, UDP_TABLE_BASIC, 0);
}
@@ -2812,7 +2636,6 @@ DWORD WINAPI
GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIP
* RETURNS
* Success: NO_ERROR
* Failure: error code from winerror.h
- *
*/
DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
{
@@ -2984,7 +2807,6 @@ DWORD WINAPI SetIfEntry(PMIB_IFROW pIfRow)
* RETURNS
* Success: NO_ERROR
* Failure: error code from winerror.h
- *
*/
DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW pRoute)
{
@@ -3163,9 +2985,6 @@ PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID)
return 0L;
}
-/*
- * @implemented
- */
#ifdef GetAdaptersAddressesV1
DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID
Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen)
{
@@ -3470,9 +3289,6 @@ DWORD GetInterfaceNameInternal(_In_ const GUID * pInterfaceGUID,
return ERROR_SUCCESS;
}
-/*
- * @implemented
- */
DWORD WINAPI
NhGetInterfaceNameFromDeviceGuid(_In_ const GUID * pInterfaceGUID,
_Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR
pInterfaceName,
@@ -3488,9 +3304,6 @@ NhGetInterfaceNameFromDeviceGuid(_In_ const GUID * pInterfaceGUID,
return GetInterfaceNameInternal(pInterfaceGUID, pInterfaceName, pOutBufLen);
}
-/*
- * @implemented
- */
DWORD WINAPI
NhGetInterfaceNameFromGuid(_In_ const GUID * pInterfaceGUID,
_Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR
pInterfaceName,
diff --git a/dll/win32/iphlpapi/ipstats_reactos.c b/dll/win32/iphlpapi/ipstats_reactos.c
index 535264caeee..d5ceaacde88 100644
--- a/dll/win32/iphlpapi/ipstats_reactos.c
+++ b/dll/win32/iphlpapi/ipstats_reactos.c
@@ -108,14 +108,14 @@ NTSTATUS tdiGetMibForIpEntity
req.ID.toi_id = IP_MIB_STATS_ID;
req.ID.toi_entity = *ent;
- status = DeviceIoControl( tcpFile,
- IOCTL_TCP_QUERY_INFORMATION_EX,
- &req,
- sizeof(req),
- entry,
- sizeof(*entry),
- &returnSize,
- NULL );
+ status = DeviceIoControl(tcpFile,
+ IOCTL_TCP_QUERY_INFORMATION_EX,
+ &req,
+ sizeof(req),
+ entry,
+ sizeof(*entry),
+ &returnSize,
+ NULL);
TRACE("TdiGetMibForIpEntity() => status = 0x%08lx, entry = {\n"
" ipsi_forwarding ............ %lu\n"
@@ -153,16 +153,16 @@ NTSTATUS tdiGetRoutesForIpEntity
TRACE("TdiGetRoutesForIpEntity(tcpFile 0x%p, entityId 0x%x)\n",
tcpFile, ent->tei_instance);
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ARPTABLE_ENTRY_ID,
- CL_NL_ENTITY,
- ent->tei_instance,
- 0,
- sizeof(IPRouteEntry),
- (PVOID *)routes,
- numRoutes);
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ARPTABLE_ENTRY_ID,
+ CL_NL_ENTITY,
+ ent->tei_instance,
+ 0,
+ sizeof(IPRouteEntry),
+ (PVOID *)routes,
+ numRoutes);
return status;
}
@@ -174,16 +174,16 @@ NTSTATUS tdiGetIpAddrsForIpEntity
TRACE("TdiGetIpAddrsForIpEntity(tcpFile 0x%p, entityId 0x%x)\n",
tcpFile, ent->tei_instance);
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ADDRTABLE_ENTRY_ID,
- CL_NL_ENTITY,
- ent->tei_instance,
- 0,
- sizeof(IPAddrEntry),
- (PVOID *)addrs,
- numAddrs );
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ADDRTABLE_ENTRY_ID,
+ CL_NL_ENTITY,
+ ent->tei_instance,
+ 0,
+ sizeof(IPAddrEntry),
+ (PVOID *)addrs,
+ numAddrs);
return status;
}
@@ -373,25 +373,26 @@ DWORD getNumRoutes(void)
TRACE("called.\n");
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
- if( !NT_SUCCESS(status) ) {
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+ if (!NT_SUCCESS(status)) {
ERR("tdiGetEntityIDSet returned 0x%08lx\n", status);
closeTcpFile( tcpFile );
return 0;
}
- for( i = 0; i < numEntities; i++ ) {
- if( isIpEntity( tcpFile, &entitySet[i] ) ) {
+ for (i = 0; i < numEntities; i++) {
+ if (isIpEntity(tcpFile, &entitySet[i])) {
IPSNMPInfo isnmp;
- memset( &isnmp, 0, sizeof( isnmp ) );
- status = tdiGetMibForIpEntity( tcpFile, &entitySet[i], &isnmp );
- if( !NT_SUCCESS(status) ) {
+ memset(&isnmp, 0, sizeof(isnmp));
+ status = tdiGetMibForIpEntity(tcpFile, &entitySet[i], &isnmp);
+ if (!NT_SUCCESS(status)) {
ERR("tdiGetMibForIpEntity returned 0x%08lx, for i = %d\n",
status, i);
numRoutes = 0;
break;
@@ -402,8 +403,8 @@ DWORD getNumRoutes(void)
TRACE("numRoutes = %lu\n", numRoutes);
- tdiFreeThingSet( entitySet );
- closeTcpFile( tcpFile );
+ tdiFreeThingSet(entitySet);
+ closeTcpFile(tcpFile);
return numRoutes;
}
@@ -427,17 +428,17 @@ RouteTable *getRouteTable(void)
DWORD numRoutes = getNumRoutes(), routesAdded = 0;
TDIEntityID ent;
HANDLE tcpFile;
- NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
+ NTSTATUS status = openTcpFile(&tcpFile, FILE_READ_DATA);
int i;
- if( !NT_SUCCESS(status) )
+ if (!NT_SUCCESS(status))
return 0;
TRACE("GETTING ROUTE TABLE\n");
- out_route_table = HeapAlloc( GetProcessHeap(), 0,
- sizeof(RouteTable) +
- (sizeof(RouteEntry) * (numRoutes - 1)) );
+ out_route_table = HeapAlloc(GetProcessHeap(), 0,
+ sizeof(RouteTable) +
+ (sizeof(RouteEntry) * (numRoutes - 1)));
if (!out_route_table) {
closeTcpFile(tcpFile);
return NULL;
@@ -445,28 +446,27 @@ RouteTable *getRouteTable(void)
out_route_table->numRoutes = numRoutes;
- for( i = 0; routesAdded < out_route_table->numRoutes; i++ ) {
+ for (i = 0; routesAdded < out_route_table->numRoutes; i++) {
int j;
IPRouteEntry *route_set;
- getNthIpEntity( tcpFile, i, &ent );
-
- tdiGetRoutesForIpEntity( tcpFile, &ent, &route_set, &numRoutes );
+ getNthIpEntity(tcpFile, i, &ent);
- if( !route_set ) {
- closeTcpFile( tcpFile );
- HeapFree( GetProcessHeap(), 0, out_route_table );
+ tdiGetRoutesForIpEntity(tcpFile, &ent, &route_set, &numRoutes);
+ if (!route_set) {
+ closeTcpFile(tcpFile);
+ HeapFree(GetProcessHeap(), 0, out_route_table);
return 0;
}
TRACE("%lu routes in instance %d\n", numRoutes, i);
#if 0
- HexDump( route_set,
- sizeof( IPRouteEntry ) *
- snmpInfo.ipsi_numroutes );
+ HexDump(route_set,
+ sizeof(IPRouteEntry) *
+ snmpInfo.ipsi_numroutes);
#endif
- for( j = 0; j < numRoutes; j++ ) {
+ for (j = 0; j < numRoutes; j++) {
int routeNum = j + routesAdded;
out_route_table->routes[routeNum].dest =
route_set[j].ire_dest;
@@ -480,15 +480,13 @@ RouteTable *getRouteTable(void)
route_set[j].ire_metric1;
}
- if( route_set ) tdiFreeThingSet( route_set );
+ if (route_set) tdiFreeThingSet(route_set);
routesAdded += numRoutes;
}
- closeTcpFile( tcpFile );
-
+ closeTcpFile(tcpFile);
TRACE("status = 0x%08lx, out_route_table = 0x%p\n", status,
out_route_table);
-
return out_route_table;
}
@@ -504,39 +502,39 @@ DWORD getNumArpEntries(void)
TRACE("called.\n");
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( isInterface( &entitySet[i] ) &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ARPTABLE_ENTRY_ID,
- AT_ENTITY,
- entitySet[i].tei_instance,
- 0,
- sizeof(MIB_IPNETROW),
- (PVOID *)&IpArpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) totalNumber += returnSize;
- if( IpArpTable ) {
- tdiFreeThingSet( IpArpTable );
- IpArpTable = NULL;
- }
- }
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (isInterface(&entitySet[i]) && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ARPTABLE_ENTRY_ID,
+ AT_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ sizeof(MIB_IPNETROW),
+ (PVOID *)&IpArpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) totalNumber += returnSize;
+ if (IpArpTable) {
+ tdiFreeThingSet(IpArpTable);
+ IpArpTable = NULL;
+ }
+ }
}
- closeTcpFile( tcpFile );
- if( entitySet ) tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ if (entitySet) tdiFreeThingSet(entitySet);
return totalNumber;
}
@@ -554,50 +552,47 @@ PMIB_IPNETTABLE getArpTable(void)
totalNumber = getNumArpEntries();
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- IpArpTable = HeapAlloc
- ( GetProcessHeap(), 0,
- sizeof(DWORD) + (sizeof(MIB_IPNETROW) * totalNumber) );
+ IpArpTable = HeapAlloc(GetProcessHeap(), 0,
+ sizeof(DWORD) + (sizeof(MIB_IPNETROW) * totalNumber));
if (!IpArpTable) {
closeTcpFile(tcpFile);
return NULL;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( isInterface( &entitySet[i] ) &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ARPTABLE_ENTRY_ID,
- AT_ENTITY,
- entitySet[i].tei_instance,
- 0,
- sizeof(MIB_IPNETROW),
- (PVOID *)&AdapterArpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) {
- for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (isInterface(&entitySet[i]) && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ARPTABLE_ENTRY_ID,
+ AT_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ sizeof(MIB_IPNETROW),
+ (PVOID *)&AdapterArpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) {
+ for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
IpArpTable->table[CurrIdx] = AdapterArpTable[TmpIdx];
- tdiFreeThingSet( AdapterArpTable );
+ tdiFreeThingSet(AdapterArpTable);
}
}
}
- closeTcpFile( tcpFile );
-
- tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ tdiFreeThingSet(entitySet);
IpArpTable->dwNumEntries = CurrIdx;
-
return IpArpTable;
}
@@ -628,39 +623,39 @@ DWORD getNumUdpEntries(void)
TRACE("called.\n");
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( entitySet[i].tei_entity == CL_TL_ENTITY &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ARPTABLE_ENTRY_ID,
- CL_TL_ENTITY,
- entitySet[i].tei_instance,
- 0,
- sizeof(MIB_UDPROW),
- (PVOID *)&IpUdpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) totalNumber += returnSize;
- if( IpUdpTable ) {
- tdiFreeThingSet( IpUdpTable );
- IpUdpTable = NULL;
- }
- }
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (entitySet[i].tei_entity == CL_TL_ENTITY && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ARPTABLE_ENTRY_ID,
+ CL_TL_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ sizeof(MIB_UDPROW),
+ (PVOID *)&IpUdpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) totalNumber += returnSize;
+ if (IpUdpTable) {
+ tdiFreeThingSet(IpUdpTable);
+ IpUdpTable = NULL;
+ }
+ }
}
- closeTcpFile( tcpFile );
- if( entitySet ) tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ if (entitySet) tdiFreeThingSet(entitySet);
return totalNumber;
}
@@ -678,52 +673,49 @@ PVOID getUdpTable(CLASS_TABLE Class)
totalNumber = getNumUdpEntries();
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- IpUdpTable = HeapAlloc
- ( GetProcessHeap(), 0,
- UdpTcpTableCall[Class].UdpOffset + (UdpTcpTableCall[Class].UdpSize * totalNumber) );
+ IpUdpTable = HeapAlloc(GetProcessHeap(), 0,
+ UdpTcpTableCall[Class].UdpOffset + (UdpTcpTableCall[Class].UdpSize *
totalNumber));
if (!IpUdpTable) {
closeTcpFile(tcpFile);
return NULL;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( entitySet[i].tei_entity == CL_TL_ENTITY &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- UdpTcpTableCall[Class].TOIID,
- CL_TL_ENTITY,
- entitySet[i].tei_instance,
- 0,
- UdpTcpTableCall[Class].UdpSize,
- &AdapterUdpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) {
- for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (entitySet[i].tei_entity == CL_TL_ENTITY && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ UdpTcpTableCall[Class].TOIID,
+ CL_TL_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ UdpTcpTableCall[Class].UdpSize,
+ &AdapterUdpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) {
+ for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
CopyMemory(Add2Ptr(IpUdpTable, UdpTcpTableCall[Class].UdpOffset +
UdpTcpTableCall[Class].UdpSize * CurrIdx),
Add2Ptr(AdapterUdpTable, UdpTcpTableCall[Class].UdpSize *
TmpIdx),
UdpTcpTableCall[Class].UdpSize);
- tdiFreeThingSet( AdapterUdpTable );
+ tdiFreeThingSet(AdapterUdpTable);
}
}
}
- closeTcpFile( tcpFile );
-
- tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ tdiFreeThingSet(entitySet);
IpUdpTable->dwNumEntries = CurrIdx;
-
return IpUdpTable;
}
@@ -739,39 +731,39 @@ DWORD getNumTcpEntries(void)
TRACE("called.\n");
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( entitySet[i].tei_entity == CO_TL_ENTITY &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- IP_MIB_ARPTABLE_ENTRY_ID,
- CO_TL_ENTITY,
- entitySet[i].tei_instance,
- 0,
- sizeof(MIB_TCPROW),
- (PVOID *)&IpTcpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) totalNumber += returnSize;
- if( IpTcpTable ) {
- tdiFreeThingSet( IpTcpTable );
- IpTcpTable = NULL;
- }
- }
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (entitySet[i].tei_entity == CO_TL_ENTITY && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ IP_MIB_ARPTABLE_ENTRY_ID,
+ CO_TL_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ sizeof(MIB_TCPROW),
+ (PVOID *)&IpTcpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) totalNumber += returnSize;
+ if (IpTcpTable) {
+ tdiFreeThingSet(IpTcpTable);
+ IpTcpTable = NULL;
+ }
+ }
}
- closeTcpFile( tcpFile );
- if( entitySet ) tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ if (entitySet) tdiFreeThingSet(entitySet);
return totalNumber;
}
@@ -789,51 +781,48 @@ PVOID getTcpTable(CLASS_TABLE Class)
totalNumber = getNumTcpEntries();
- status = openTcpFile( &tcpFile, FILE_READ_DATA );
- if( !NT_SUCCESS(status) ) {
+ status = openTcpFile(&tcpFile, FILE_READ_DATA);
+ if (!NT_SUCCESS(status))
+ {
ERR("openTcpFile returned 0x%08lx\n", status);
return 0;
}
- IpTcpTable = HeapAlloc
- ( GetProcessHeap(), 0,
- UdpTcpTableCall[Class].TcpOffset + (UdpTcpTableCall[Class].TcpSize * totalNumber) );
+ IpTcpTable = HeapAlloc(GetProcessHeap(), 0,
+ UdpTcpTableCall[Class].TcpOffset + (UdpTcpTableCall[Class].TcpSize *
totalNumber));
if (!IpTcpTable) {
closeTcpFile(tcpFile);
return NULL;
}
- status = tdiGetEntityIDSet( tcpFile, &entitySet, &numEntities );
-
- for( i = 0; i < numEntities; i++ ) {
- if( entitySet[i].tei_entity == CO_TL_ENTITY &&
- hasArp( tcpFile, &entitySet[i] ) ) {
-
- status = tdiGetSetOfThings( tcpFile,
- INFO_CLASS_PROTOCOL,
- INFO_TYPE_PROVIDER,
- UdpTcpTableCall[Class].TOIID,
- CO_TL_ENTITY,
- entitySet[i].tei_instance,
- 0,
- UdpTcpTableCall[Class].TcpSize,
- &AdapterTcpTable,
- &returnSize );
-
- if( status == STATUS_SUCCESS ) {
- for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
+ status = tdiGetEntityIDSet(tcpFile, &entitySet, &numEntities);
+
+ for (i = 0; i < numEntities; i++) {
+ if (entitySet[i].tei_entity == CO_TL_ENTITY && hasArp(tcpFile,
&entitySet[i]))
+ {
+ status = tdiGetSetOfThings(tcpFile,
+ INFO_CLASS_PROTOCOL,
+ INFO_TYPE_PROVIDER,
+ UdpTcpTableCall[Class].TOIID,
+ CO_TL_ENTITY,
+ entitySet[i].tei_instance,
+ 0,
+ UdpTcpTableCall[Class].TcpSize,
+ &AdapterTcpTable,
+ &returnSize);
+
+ if (status == STATUS_SUCCESS) {
+ for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
CopyMemory(Add2Ptr(IpTcpTable, UdpTcpTableCall[Class].TcpOffset +
UdpTcpTableCall[Class].TcpSize * CurrIdx),
Add2Ptr(AdapterTcpTable, UdpTcpTableCall[Class].TcpSize *
TmpIdx),
UdpTcpTableCall[Class].TcpSize);
- tdiFreeThingSet( AdapterTcpTable );
+ tdiFreeThingSet(AdapterTcpTable);
}
}
}
- closeTcpFile( tcpFile );
-
- tdiFreeThingSet( entitySet );
+ closeTcpFile(tcpFile);
+ tdiFreeThingSet(entitySet);
IpTcpTable->dwNumEntries = CurrIdx;
-
return IpTcpTable;
}