Louis Lenders : ws2_32: Add FreeAddrInfoEx.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 13:46:21 CST 2020


Module: wine
Branch: stable
Commit: 1cbda58252c4c358f950dfabc01e5ffe3237dd51
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1cbda58252c4c358f950dfabc01e5ffe3237dd51

Author: Louis Lenders <xerox.xerox2000x at gmail.com>
Date:   Wed Jun 17 00:43:22 2020 +0200

ws2_32: Add FreeAddrInfoEx.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48256
Signed-off-by: Louis Lenders <xerox.xerox2000x at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 6d1fea9711d5062fdcfe5043091451c8aec56023)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ws2_32/socket.c    | 18 ++++++++++++++++++
 dlls/ws2_32/ws2_32.spec |  1 +
 include/ws2tcpip.h      |  4 ++++
 3 files changed, 23 insertions(+)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 5c3d1a0dc02..fbfef0aad52 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -7243,6 +7243,24 @@ void WINAPI FreeAddrInfoW(PADDRINFOW ai)
     }
 }
 
+/***********************************************************************
+ *      FreeAddrInfoEx      (WS2_32.@)
+ */
+void WINAPI FreeAddrInfoEx(ADDRINFOEXA *ai)
+{
+    TRACE("(%p)\n", ai);
+
+    while (ai)
+    {
+        ADDRINFOEXA *next;
+        HeapFree(GetProcessHeap(), 0, ai->ai_canonname);
+        HeapFree(GetProcessHeap(), 0, ai->ai_addr);
+        next = ai->ai_next;
+        HeapFree(GetProcessHeap(), 0, ai);
+        ai = next;
+    }
+}
+
 /***********************************************************************
  *      FreeAddrInfoExW      (WS2_32.@)
  */
diff --git a/dlls/ws2_32/ws2_32.spec b/dlls/ws2_32/ws2_32.spec
index ae3eaf0c90c..8a27972d93c 100644
--- a/dlls/ws2_32/ws2_32.spec
+++ b/dlls/ws2_32/ws2_32.spec
@@ -50,6 +50,7 @@
 
 500 stub     WEP
 
+@ stdcall FreeAddrInfoEx(ptr)
 @ stdcall FreeAddrInfoExW(ptr)
 @ stdcall FreeAddrInfoW(ptr)
 @ stdcall GetAddrInfoExCancel(ptr)
diff --git a/include/ws2tcpip.h b/include/ws2tcpip.h
index 43c277fa0cb..5a444dcb5f3 100644
--- a/include/ws2tcpip.h
+++ b/include/ws2tcpip.h
@@ -177,7 +177,11 @@ void WINAPI WS(freeaddrinfo)(LPADDRINFO);
 #define     FreeAddrInfoA WS(freeaddrinfo)
 void WINAPI FreeAddrInfoW(PADDRINFOW);
 #define     FreeAddrInfo WINELIB_NAME_AW(FreeAddrInfo)
+void WINAPI FreeAddrInfoEx(ADDRINFOEXA*);
 void WINAPI FreeAddrInfoExW(ADDRINFOEXW*);
+#ifdef UNICODE
+#define     FreeAddrInfoEx FreeAddrInfoExW
+#endif
 int WINAPI  WS(getaddrinfo)(const char*,const char*,const struct WS(addrinfo)*,struct WS(addrinfo)**);
 #define     GetAddrInfoA WS(getaddrinfo)
 int WINAPI  GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*);




More information about the wine-cvs mailing list