Author: tfaber
Date: Sun Jan 19 14:56:13 2014
New Revision: 61707
URL:
http://svn.reactos.org/svn/reactos?rev=61707&view=rev
Log:
[DDK][NDK][RTL][WS2_32_NEW]
- Add missing and improve existing declarations of RtlIpv4StringToAddress*
Modified:
trunk/reactos/dll/win32/ws2_32_new/src/addrinfo.c
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/psdk/mstcpip.h
trunk/reactos/lib/rtl/network.c
Modified: trunk/reactos/dll/win32/ws2_32_new/src/addrinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32_new/src/a…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32_new/src/addrinfo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32_new/src/addrinfo.c [iso-8859-1] Sun Jan 19 14:56:13
2014
@@ -87,15 +87,18 @@
ParseV4Address(IN PCWSTR AddressString,
OUT PDWORD pAddress)
{
- DWORD Address;
- LPWSTR Ip = 0;
-
- /* Do the conversion, don't accept wildcard */
- RtlIpv4StringToAddressW((LPWSTR)AddressString, 0, &Ip, (IN_ADDR *)&Address);
-
- /* Return the address and success */
- *pAddress = Address;
- return FALSE;
+ IN_ADDR Address;
+ PCWSTR Terminator;
+ NTSTATUS Status;
+
+ *pAddress = 0;
+ Status = RtlIpv4StringToAddressW(AddressString, FALSE, &Terminator,
&Address);
+
+ if (!NT_SUCCESS(Status))
+ return FALSE;
+
+ *pAddress = Address.S_un.S_addr;
+ return TRUE;
}
static
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sun Jan 19 14:56:13 2014
@@ -3994,11 +3994,41 @@
NTSYSAPI
NTSTATUS
NTAPI
+RtlIpv4StringToAddressA(
+ _In_ PCSTR String,
+ _In_ BOOLEAN Strict,
+ _Out_ PCSTR *Terminator,
+ _Out_ struct in_addr *Addr
+);
+
+NTSYSAPI
+NTSTATUS
+NTAPI
RtlIpv4StringToAddressW(
_In_ PCWSTR String,
_In_ BOOLEAN Strict,
- _Out_ LPWSTR *Terminator,
+ _Out_ PCWSTR *Terminator,
_Out_ struct in_addr *Addr
+);
+
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlIpv4StringToAddressExA(
+ _In_ PCSTR AddressString,
+ _In_ BOOLEAN Strict,
+ _Out_ struct in_addr *Address,
+ _Out_ PUSHORT Port
+);
+
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlIpv4StringToAddressExW(
+ _In_ PCWSTR AddressString,
+ _In_ BOOLEAN Strict,
+ _Out_ struct in_addr *Address,
+ _Out_ PUSHORT Port
);
NTSYSAPI
Modified: trunk/reactos/include/psdk/mstcpip.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mstcpip.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/mstcpip.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/mstcpip.h [iso-8859-1] Sun Jan 19 14:56:13 2014
@@ -1340,7 +1340,7 @@
LONG
NTAPI
RtlIpv4StringToAddressA(
- _In_ PCSTR S,
+ _In_ PCSTR String,
_In_ BOOLEAN Strict,
_Out_ PCSTR *Terminator,
_Out_ struct in_addr *Addr);
@@ -1358,9 +1358,9 @@
LONG
NTAPI
RtlIpv4StringToAddressW(
- _In_ PCWSTR S,
+ _In_ PCWSTR String,
_In_ BOOLEAN Strict,
- _Out_ LPCWSTR *Terminator,
+ _Out_ PCWSTR *Terminator,
_Out_ struct in_addr *Addr);
NTSYSAPI
Modified: trunk/reactos/lib/rtl/network.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/network.c?rev=6170…
==============================================================================
--- trunk/reactos/lib/rtl/network.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/network.c [iso-8859-1] Sun Jan 19 14:56:13 2014
@@ -32,7 +32,7 @@
OUT PCHAR S)
{
INT Length;
-
+
if (!S) return (LPSTR)~0;
Length = sprintf(S, "%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
@@ -88,7 +88,7 @@
INT Length;
if (!S) return (LPWSTR)~0;
-
+
Length = swprintf(S, L"%u.%u.%u.%u", Addr->S_un.S_un_b.s_b1,
Addr->S_un.S_un_b.s_b2,
Addr->S_un.S_un_b.s_b3,
@@ -135,9 +135,9 @@
*/
NTSTATUS
NTAPI
-RtlIpv4StringToAddressA(IN PCHAR String,
+RtlIpv4StringToAddressA(IN PCSTR String,
IN BOOLEAN Strict,
- OUT PCHAR *Terminator,
+ OUT PCSTR *Terminator,
OUT struct in_addr *Addr)
{
UNIMPLEMENTED;
@@ -149,10 +149,10 @@
*/
NTSTATUS
NTAPI
-RtlIpv4StringToAddressExA(IN PCHAR AddressString,
+RtlIpv4StringToAddressExA(IN PCSTR AddressString,
IN BOOLEAN Strict,
OUT struct in_addr *Address,
- IN PUSHORT Port)
+ OUT PUSHORT Port)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
@@ -165,7 +165,7 @@
NTAPI
RtlIpv4StringToAddressW(IN PCWSTR String,
IN BOOLEAN Strict,
- OUT LPWSTR *Terminator,
+ OUT PCWSTR *Terminator,
OUT struct in_addr *Addr)
{
UNIMPLEMENTED;
@@ -177,7 +177,7 @@
*/
NTSTATUS
NTAPI
-RtlIpv4StringToAddressExW(IN PWCHAR AddressString,
+RtlIpv4StringToAddressExW(IN PCWSTR AddressString,
IN BOOLEAN Strict,
OUT struct in_addr *Address,
OUT PUSHORT Port)