Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function sends an Internet Control Message Protocol (ICMP) echo request, and returns one or more replies.

Syntax

DWORD WINAPI IcmpSendEcho(
  HANDLE 
IcmpHandle, 
  IPAddr 
DestinationAddress,
  LPVOID 
RequestData, 
  WORD 
RequestSize, 
  PIP_OPTION_INFORMATION 
RequestOptions, 
  LPVOID 
ReplyBuffer,
  DWORD 
ReplySize, 
  DWORD 
Timeout 
); 

Parameters

IcmpHandle

[in] ICMP handle opened by IcmpCreateFile.

DestinationAddress

[in] Specifies the destination of the echo request.

RequestData

[in] Buffer that contains the data to be sent in the request.

RequestSize

[in] Number of bytes in the RequestDatabuffer.

RequestOptions

[in] Pointer to the IP header options for the request; may be NULL. IP_OPT_TS, timestamp, and IP_OPT_RR, record route, are supported.

ReplyBuffer

[out] Buffer to hold any replies to the request. When the function returns, the buffer will contain one or more ICMP_ECHO_REPLYstructures, followed by options and data.

ReplySize

[out] Size, in bytes, of the reply buffer. The buffer must be large enough to accommodate at least one ICMP_ECHO_REPLYstructure plus eight additional bytes (the size of an ICMP error message).

Timeout

[in] Time, in milliseconds, to wait for replies.

Return Value

The number of replies received and stored in the reply buffer indicates success. Zero indicates failure. Extended error information is available through GetLastError.

Requirements

Header icmpapi.h
Library icmplib.lib
Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also