Hans Leidekker : iphlpapi: Reimplement GetTcpTable on top of GetExtendedTcpTable.

Alexandre Julliard julliard at winehq.org
Mon Apr 16 13:35:47 CDT 2012


Module: wine
Branch: master
Commit: d4ebc5298f17aa749c675b494d0b09b510e45f01
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d4ebc5298f17aa749c675b494d0b09b510e45f01

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Apr 16 12:36:00 2012 +0200

iphlpapi: Reimplement GetTcpTable on top of GetExtendedTcpTable.

---

 dlls/iphlpapi/iphlpapi_main.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 2654571..961736f 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1853,28 +1853,8 @@ BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHo
  */
 DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
 {
-    DWORD ret;
-    PMIB_TCPTABLE table;
-
     TRACE("pTcpTable %p, pdwSize %p, bOrder %d\n", pTcpTable, pdwSize, bOrder);
-
-    if (!pdwSize) return ERROR_INVALID_PARAMETER;
-
-    ret = AllocateAndGetTcpTableFromStack(&table, bOrder, GetProcessHeap(), 0);
-    if (!ret) {
-        DWORD size = FIELD_OFFSET( MIB_TCPTABLE, table[table->dwNumEntries] );
-        if (!pTcpTable || *pdwSize < size) {
-          *pdwSize = size;
-          ret = ERROR_INSUFFICIENT_BUFFER;
-        }
-        else {
-          *pdwSize = size;
-          memcpy(pTcpTable, table, size);
-        }
-        HeapFree(GetProcessHeap(), 0, table);
-    }
-    TRACE("returning %d\n", ret);
-    return ret;
+    return GetExtendedTcpTable(pTcpTable, pdwSize, bOrder, AF_INET, TCP_TABLE_BASIC_ALL, 0);
 }
 
 /******************************************************************




More information about the wine-cvs mailing list