Commit 363b8809 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

ntdll: Implement RtlIpv4StringToAddress(Ex)A.

parent e9ee0df5
......@@ -760,8 +760,8 @@
@ 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
......
......@@ -1040,6 +1040,41 @@ NTSTATUS WINAPI RtlIpv4StringToAddressW(const WCHAR *str, BOOLEAN strict, const
}
/***********************************************************************
* RtlIpv4StringToAddressExA [NTDLL.@]
*/
NTSTATUS WINAPI RtlIpv4StringToAddressExA(const char *str, BOOLEAN strict, IN_ADDR *address, USHORT *port)
{
WCHAR wstr[32];
TRACE("(%s, %u, %p, %p)\n", debugstr_a(str), strict, address, port);
if (!str || !address || !port)
return STATUS_INVALID_PARAMETER;
RtlMultiByteToUnicodeN(wstr, sizeof(wstr), NULL, str, strlen(str) + 1);
wstr[ARRAY_SIZE(wstr) - 1] = 0;
return ipv4_string_to_address(wstr, strict, NULL, address, port);
}
/***********************************************************************
* RtlIpv4StringToAddressA [NTDLL.@]
*/
NTSTATUS WINAPI RtlIpv4StringToAddressA(const char *str, BOOLEAN strict, const char **terminator, IN_ADDR *address)
{
WCHAR wstr[32];
const WCHAR *wterminator;
NTSTATUS ret;
TRACE("(%s, %u, %p, %p)\n", debugstr_a(str), strict, terminator, address);
RtlMultiByteToUnicodeN(wstr, sizeof(wstr), NULL, str, strlen(str) + 1);
wstr[ARRAY_SIZE(wstr) - 1] = 0;
ret = ipv4_string_to_address(wstr, strict, &wterminator, address, NULL);
if (terminator) *terminator = str + (wterminator - wstr);
return ret;
}
/***********************************************************************
* RtlIpv6StringToAddressExW [NTDLL.@]
*/
NTSTATUS NTAPI RtlIpv6StringToAddressExW(const WCHAR *str, IN6_ADDR *address, ULONG *scope, USHORT *port)
......
......@@ -1102,8 +1102,8 @@
@ 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) ntdll.RtlIpv4StringToAddressA
@ stdcall RtlIpv4StringToAddressExA(str long ptr ptr) ntdll.RtlIpv4StringToAddressExA
@ stdcall RtlIpv4StringToAddressExW(wstr long ptr ptr)
@ stdcall RtlIpv4StringToAddressW(wstr long ptr ptr)
@ stub RtlIpv6AddressToStringA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment