Philipp Hoppermann : ws2_32: Implement InetNtopW.

Alexandre Julliard julliard at winehq.org
Mon Jul 25 10:02:30 CDT 2016


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

Author: Philipp Hoppermann <plata at mailbox.org>
Date:   Sat Jul 23 01:21:23 2016 -0300

ws2_32: Implement InetNtopW.

Signed-off-by: Philipp Hoppermann <plata at mailbox.org>
Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/socket.c    | 20 ++++++++++++++++++++
 dlls/ws2_32/ws2_32.spec |  1 +
 2 files changed, 21 insertions(+)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index b0af3d7..79ccfc2 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -7934,6 +7934,26 @@ INT WINAPI InetPtonW(INT family, PCWSTR addr, PVOID buffer)
 }
 
 /***********************************************************************
+ *              InetNtopW                      (WS2_32.@)
+ */
+PCWSTR WINAPI InetNtopW(INT family, PVOID addr, PWSTR buffer, SIZE_T len)
+{
+    char bufferA[WS_INET6_ADDRSTRLEN];
+    PWSTR ret = NULL;
+
+    TRACE("family %d, addr (%p), buffer (%p), len %ld\n", family, addr, buffer, len);
+
+    if (WS_inet_ntop(family, addr, bufferA, sizeof(bufferA)))
+    {
+        if (MultiByteToWideChar(CP_ACP, 0, bufferA, -1, buffer, len))
+            ret = buffer;
+        else
+            SetLastError(ERROR_INVALID_PARAMETER);
+    }
+    return ret;
+}
+
+/***********************************************************************
  *              WSAStringToAddressA                      (WS2_32.80)
  */
 INT WINAPI WSAStringToAddressA(LPSTR AddressString,
diff --git a/dlls/ws2_32/ws2_32.spec b/dlls/ws2_32/ws2_32.spec
index 7625f38..0482b7d 100644
--- a/dlls/ws2_32/ws2_32.spec
+++ b/dlls/ws2_32/ws2_32.spec
@@ -54,6 +54,7 @@
 @ stdcall GetAddrInfoExW(wstr wstr long ptr ptr ptr ptr ptr ptr ptr)
 @ stdcall GetAddrInfoW(wstr wstr ptr ptr)
 @ stdcall GetNameInfoW(ptr long ptr long ptr long long)
+@ stdcall InetNtopW(long ptr ptr long)
 @ stdcall InetPtonW(long wstr ptr)
 @ stdcall WSApSetPostRoutine(ptr)
 @ stdcall WPUCompleteOverlappedRequest(long ptr long long ptr)




More information about the wine-cvs mailing list