Skip to content

Latest commit

 

History

History
111 lines (76 loc) · 4.45 KB

nf-ws2tcpip-freeaddrinfow.md

File metadata and controls

111 lines (76 loc) · 4.45 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:ws2tcpip.FreeAddrInfoW
FreeAddrInfoW function (ws2tcpip.h)
Frees address information that the GetAddrInfoW function dynamically allocates in addrinfoW structures.
FreeAddrInfoW
FreeAddrInfoW function [Winsock]
winsock.freeaddrinfow
ws2tcpip/FreeAddrInfoW
winsock\freeaddrinfow.htm
WinSock
0a2a226c-2068-4538-b499-04cfbfd65b8a
12/05/2018
FreeAddrInfoW, FreeAddrInfoW function [Winsock], winsock.freeaddrinfow, ws2tcpip/FreeAddrInfoW
ws2tcpip.h
Windows
Windows 8.1, Windows Vista [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
Ws2_32.lib
Ws2_32.dll
Windows
19H1
FreeAddrInfoW
ws2tcpip/FreeAddrInfoW
c++
APIRef
kbSyntax
DllExport
Ws2_32.dll
FreeAddrInfoW

FreeAddrInfoW function

-description

The FreeAddrInfoW function frees address information that the GetAddrInfoW function dynamically allocates in addrinfoW structures.

-parameters

-param pAddrInfo [in]

A pointer to the addrinfoW structure or linked list of addrinfoW structures to be freed. All dynamic storage pointed to within the addrinfoW structure or structures is also freed.

-returns

This function does not return a value.

-remarks

The FreeAddrInfoW function frees addrinfoW structures dynamically allocated by the Unicode GetAddrInfoW function. The FreeAddrInfoW function frees the initial addrinfoW structure pointed to in the pAddrInfo parameter, including any buffers to which structure members point, then continues freeing any addrinfoW structures linked by the ai_next member of the addrinfoW structure. The FreeAddrInfoW function continues freeing linked structures until a NULL ai_next member is encountered.

Macros in the Winsock header file define a mixed-case function name of FreeAddrInfo and an ADDRINFOT structure. This FreeAddrInfo function should be called with the pAddrInfo parameter of a pointer of type ADDRINFOT. When UNICODE or _UNICODE is defined, FreeAddrInfo is defined to FreeAddrInfoW, the Unicode version of the function, and ADDRINFOT is defined to the addrinfoW structure. When UNICODE or _UNICODE is not defined, FreeAddrInfo is defined to freeaddrinfo, the ANSI version of the function, and ADDRINFOT is defined to the addrinfo structure.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Note

The ws2tcpip.h header defines FreeAddrInfo as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

GetAddrInfoW

Winsock Functions

addrinfo

addrinfoW

freeaddrinfo

getaddrinfo