2019-08-30 21:25:05 -07:00
|
|
|
From 2f39a185e26072c7c776a1475236d798ebf267f0 Mon Sep 17 00:00:00 2001
|
2019-07-09 16:49:35 -07:00
|
|
|
From: Alex Henrie <alexhenrie24@gmail.com>
|
2019-08-30 21:25:05 -07:00
|
|
|
Date: Sun, 25 Aug 2019 17:18:06 -0600
|
|
|
|
Subject: [PATCH 2/4] ntdll: Implement RtlIpv4StringToAddress(Ex)A
|
2019-07-09 16:49:35 -07:00
|
|
|
|
|
|
|
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46149
|
|
|
|
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
|
|
|
|
---
|
2019-08-30 21:25:05 -07:00
|
|
|
dlls/ntdll/ntdll.spec | 4 ++--
|
|
|
|
dlls/ntdll/rtl.c | 33 +++++++++++++++++++++++++++++++++
|
|
|
|
2 files changed, 35 insertions(+), 2 deletions(-)
|
2019-07-09 16:49:35 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
2019-08-30 21:25:05 -07:00
|
|
|
index 82c78f6e78..8cacc97ec4 100644
|
2019-07-09 16:49:35 -07:00
|
|
|
--- a/dlls/ntdll/ntdll.spec
|
|
|
|
+++ b/dlls/ntdll/ntdll.spec
|
2019-08-30 21:25:05 -07:00
|
|
|
@@ -760,8 +760,8 @@
|
2019-07-09 16:49:35 -07:00
|
|
|
@ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr)
|
|
|
|
@ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr)
|
|
|
|
@ stdcall RtlIpv4AddressToStringW(ptr ptr)
|
|
|
|
-# @ stub RtlIpv4StringToAddressA
|
|
|
|
-# @ stub RtlIpv4StringToAddressExA
|
|
|
|
+@ stdcall RtlIpv4StringToAddressA(str long ptr ptr)
|
|
|
|
+@ stdcall RtlIpv4StringToAddressExA(str long ptr ptr)
|
|
|
|
@ stdcall RtlIpv4StringToAddressExW(wstr long ptr ptr)
|
|
|
|
@ stdcall RtlIpv4StringToAddressW(wstr long ptr ptr)
|
|
|
|
# @ stub RtlIpv6AddressToStringA
|
|
|
|
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
|
2019-08-30 21:25:05 -07:00
|
|
|
index 72ecfd937a..1604513e7e 100644
|
2019-07-09 16:49:35 -07:00
|
|
|
--- a/dlls/ntdll/rtl.c
|
|
|
|
+++ b/dlls/ntdll/rtl.c
|
2019-08-30 21:25:05 -07:00
|
|
|
@@ -1039,6 +1039,39 @@ NTSTATUS WINAPI RtlIpv4StringToAddressW(const WCHAR *str, BOOLEAN strict, const
|
|
|
|
return ipv4_string_to_address(str, strict, terminator, address, NULL);
|
2019-07-09 16:49:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
+/***********************************************************************
|
|
|
|
+ * RtlIpv4StringToAddressExA [NTDLL.@]
|
|
|
|
+ */
|
|
|
|
+NTSTATUS WINAPI RtlIpv4StringToAddressExA(const char *str, BOOLEAN strict, IN_ADDR *address, USHORT *port)
|
|
|
|
+{
|
2019-08-30 21:25:05 -07:00
|
|
|
+ WCHAR wstr[32];
|
|
|
|
+
|
2019-07-09 16:49:35 -07:00
|
|
|
+ TRACE("(%s, %u, %p, %p)\n", debugstr_a(str), strict, address, port);
|
2019-08-30 21:25:05 -07:00
|
|
|
+
|
|
|
|
+ if (!str || !address || !port)
|
|
|
|
+ return STATUS_INVALID_PARAMETER;
|
|
|
|
+
|
|
|
|
+ RtlMultiByteToUnicodeN(wstr, sizeof(wstr), NULL, str, strlen(str) + 1);
|
|
|
|
+ return ipv4_string_to_address(wstr, strict, NULL, address, port);
|
2019-07-09 16:49:35 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/***********************************************************************
|
|
|
|
+ * RtlIpv4StringToAddressA [NTDLL.@]
|
|
|
|
+ */
|
|
|
|
+NTSTATUS WINAPI RtlIpv4StringToAddressA(const char *str, BOOLEAN strict, const char **terminator, IN_ADDR *address)
|
|
|
|
+{
|
2019-08-30 21:25:05 -07:00
|
|
|
+ WCHAR wstr[32];
|
|
|
|
+ const WCHAR *wterminator;
|
|
|
|
+ NTSTATUS ret;
|
|
|
|
+
|
2019-07-09 16:49:35 -07:00
|
|
|
+ TRACE("(%s, %u, %p, %p)\n", debugstr_a(str), strict, terminator, address);
|
2019-08-30 21:25:05 -07:00
|
|
|
+
|
|
|
|
+ RtlMultiByteToUnicodeN(wstr, sizeof(wstr), NULL, str, strlen(str) + 1);
|
|
|
|
+ ret = ipv4_string_to_address(wstr, strict, &wterminator, address, NULL);
|
|
|
|
+ if (terminator) *terminator = str + (wterminator - wstr);
|
|
|
|
+ return ret;
|
2019-07-09 16:49:35 -07:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
/***********************************************************************
|
2019-08-30 21:25:05 -07:00
|
|
|
* RtlIpv6StringToAddressExW [NTDLL.@]
|
2019-07-09 16:49:35 -07:00
|
|
|
*/
|
|
|
|
--
|
2019-08-30 21:25:05 -07:00
|
|
|
2.23.0
|
2019-07-09 16:49:35 -07:00
|
|
|
|