Share via


IcmpSendEcho2 (Compact 2013)

3/26/2014

This function sends an ICMP echo request and the call returns either immediately, if the Event parameter is non-NULL, or returns after the specified timeout. The ReplyBuffer contains the ICMP responses, if any.

Syntax

IcmpSendEcho2(
  HANDLE IcmpHandle,
  HANDLE Event,
  #ifdef PIO_APC_ROUTINE_DEFINED
  PIO_APC_ROUTINE ApcRoutine,
  #else
  FARPROC ApcRoutine,
  #endif
  PVOID ApcContext,
  IPAddr DestinationAddress,
  LPVOID RequestData,
  WORD RequestSize,
  PIP_OPTION_INFORMATION RequestOptions,
  LPVOID ReplyBuffer,
  DWORD ReplySize,
  DWORD Timeout
);

Parameters

  • Event
    Event to be signalled whenever an ICMPv6 response comes in.
  • ApcRoutine
    Parameter that is always set to NULL in Windows Embedded Compact.
  • ApcContext
    Optional. This parameter is given to the ApcRoutine parameter when this call succeeds.
  • DestinationAddress
    The destination of the echo request.
  • RequestData
    A buffer containing the data to send in the request.
  • RequestSize
    The number of bytes in the request data buffer.
  • RequestOptions
    Pointer to the IP header options for the request. This parameter may be NULL.
  • ReplyBuffer
    A buffer to hold any replies to the request. On return, the buffer will contain an array of ICMP_ECHO_REPLY structures followed by options and data. The buffer must be large enough to hold at least one ICMP_ECHO_REPLY structure. It should be large enough also to hold 8 more bytes of data to accommodate an ICMP error message.
  • ReplySize
    The size in bytes of the reply buffer.
  • Timeout
    The time in milliseconds to wait for replies.

    This is not used if either ApcRoutine or Event is not NULL.

Return Value

Returns the number of replies received and stored in ReplyBuffer. Zero indicates failure. Extended error information is available through GetLastError.

Remarks

On platforms not based on Windows NT, the Event, ApcRoutine and ApcContext parameters are ignored.

Requirements

Header

icmpapi.h

Library

icmplib.lib

See Also

Reference

ICMP Functions
IcmpCreateFile