IcmpParseReplies function (icmpapi.h)

The IcmpParseReplies function parses the reply buffer provided and returns the number of ICMP echo request responses found.

Syntax

IPHLPAPI_DLL_LINKAGE DWORD IcmpParseReplies(
  [in] LPVOID ReplyBuffer,
  [in] DWORD  ReplySize
);

Parameters

[in] ReplyBuffer

The buffer passed to IcmpSendEcho2. This is rewritten to hold an array of ICMP_ECHO_REPLY structures, its type is PICMP_ECHO_REPLY.

On a 64-bit platform, this buffer is rewritten to hold an array of ICMP_ECHO_REPLY32 structures, its type is PICMP_ECHO_REPLY32.

[in] ReplySize

The size, in bytes, of the buffer pointed to by the ReplyBuffer parameter.

Return value

The IcmpParseReplies function returns the number of ICMP responses found on success. The function returns zero on error. Call GetLastError for additional error information.

Remarks

The IcmpParseReplies function should not be used on a reply buffer previously passed to IcmpSendEcho. The IcmpSendEcho function parses that buffer before returning to the user. Use this function only with IcmpSendEcho2.

The IcmpParseReplies function is exported from the Icmp.dll on Windows 2000. The IcmpParseReplies function is exported from the Iphlpapi.dll on Windows XP and later. Windows version checking is not recommended to use this function. Applications requiring portability with this function across Windows 2000, Windows XP, Windows Server 2003 and later Windows versions should not statically link to either the Icmp.lib or the Iphlpapi.lib file. Instead, the application should check for the presence of IcmpParseReplies in the Iphlpapi.dll with calls to LoadLibrary and GetProcAddress. Failing that, the application should check for the presence of IcmpParseReplies in the Icmp.dll with calls to LoadLibrary and GetProcAddress.

Note that the include directive for Iphlpapi.h header file must be placed before the Icmpapi.h header file.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header icmpapi.h
Library Iphlpapi.lib
DLL Iphlpapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP; Icmp.dll on Windows 2000 Server and Windows 2000 Professional

See also

GetLastError

ICMP_ECHO_REPLY

ICMP_ECHO_REPLY32

Icmp6CreateFile

Icmp6ParseReplies

Icmp6SendEcho2

IcmpCloseHandle

IcmpCreateFile

IcmpSendEcho

IcmpSendEcho2

IcmpSendEcho2Ex