IcmpSendEcho2

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.

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

  • IcmpHandle
    An open handle returned by IcmpCreateFile.

  • Event
    Event to be signalled whenever an ICMPv6 response comes in.

  • ApcRoutine
    Parameter that is always set to NULL in Windows CE.

  • 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 Values

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

OS Versions: Windows CE .NET 4.1 and later.
Header: Icmpapi.h.
Library: Iphlpapi.dll.

OS Versions: Windows CE 2.12 through .NET 4.0
Header: Icmpapi.h.
Library: Icmplib.lib.

See Also

ICMP Functions | IcmpCreateFile

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.