Just a small comment... You code god already know the structure of IcmpSendEcho, anyway here it is:
[in] Open handle returned by IcmpCreateFile.
[in] Specifies the destination of the echo request.
[in] Specifies the buffer that contains the data to send in the request.
[in] Specifies the number of bytes in the request data buffer.
[out] Buffer to hold any replies to the request. Upon return, the buffer contains an array of ICMP_ECHO_REPLY structures followed by the options and data for the replies. The buffer should be large enough to hold at least one ICMP_ECHO_REPLY structure plus MAX(RequestSize, 8) bytes of data since an ICMP error message contains 8 bytes of data.
[out] Receives the size in bytes of the reply buffer.
[out] Recieves the time in milliseconds to wait for replies.
Returns the number of ICMP_ECHO_REPLY structures stored in ReplyBuffer. The status of each reply is contained in the structure. If the return value is zero, see the extended error information available through GetLastError.
So, what my lame brain allows me to understand is that if thereīs some reply in a time lower than the Timeout value, the function will return immediately after this reply and the return value will be '1' because thereīs ONE reply in the buffer and if thereīs no reply and the Timeout value is reached the function will return immediately at the Timeout time and the return value will be '0' because there is no reply in the buffer. Do this really works like that? Or am I misunderstanding everything?