RtlIpv4AddressToString function
The RtlIpv4AddressToString function converts an IPv4 address to a string in Internet standard dotted-decimal format.
Syntax
PTSTR NTAPI RtlIpv4AddressToString(
_In_ const IN_ADDR *Addr,
_Out_ PTSTR S
);
Parameters
- Addr [in]
-
The IPv4 address in network byte order.
- S [out]
-
A pointer to a buffer in which to store the NULL-terminated string representation of the IPv4 address. This buffer should be large enough to hold at least 16 characters.
Return value
A pointer to the NULL character inserted at the end of the string representation of the IPv4 address. This can be used by the caller to easily append more information to the string.
Remarks
The RtlIpv4AddressToString function is used to convert an IPv4 address to the string representation of the IPv4 address in Internet dotted-decimal format.
RtlIpv4AddressToString is a convenience function that does not require that the Windows Sockets DLL be loaded to access a function provided in Windows Sockets to perform IP address to string conversion.
When either UNICODE or _UNICODE is defined, RtlIpv4AddressToString is defined to RtlIpv4AddressToStringW, the Unicode version of this function. The string parameter S and the function return value are defined to the PWSTR data type.
When both UNICODE and _UNICODE are not defined, RtlIpv4AddressToString is defined to RtlIpv4AddressToStringA, the ANSI version of this function. The string parameter S and the function return value are defined to the PSTR data type.
The IN_ADDR structure is defined in the Inaddr.h header file.
An import library containing the RtlIpv4AddressToString function is not included in the Microsoft Windows Software Development Kit (SDK) released for Windows Vista. The RtlIpv4AddressToString function is included in the Ntdll.lib import library included in the Windows Driver Kit (WDK). An application could also use the GetModuleHandle and GetProcAddress functions to retrieve the function pointer from the Ntdll.dll and call this function.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
DLL |
|
|
Unicode and ANSI names |
RtlIpv4AddressToStringW (Unicode) and RtlIpv4AddressToStringA (ANSI) |
See also
- GetModuleHandle
- GetProcAddress
- inet_addr
- inet_ntoa
- InetNtop
- InetPton
- LoadLibrary
- RtlIpv4AddressToStringEx
- RtlIpv4StringToAddress
- RtlIpv4StringToAddressEx
- RtlIpv6AddressToString
- RtlIpv6AddressToStringEx
- RtlIpv6StringToAddress
- RtlIpv6StringToAddressEx