32#define WIN32_LEAN_AND_MEAN
34#define WIN32_NO_STATUS
49#define SIZEOF_ICMP_ERROR 8
50#define SIZEOF_IO_STATUS_BLOCK 8
51#define DEFAULT_TIMEOUT 1000
52#define MAX_SEND_SIZE 65500
56static void Ping(
void);
429 if (SendBuffer ==
NULL)
445 ReplySize +=
sizeof(ICMP_ECHO_REPLY32);
512 ZeroMemory(&SockAddrIn6,
sizeof(SockAddrIn6));
538 switch (pEchoReply->
Status)
581 PICMP_ECHO_REPLY32 pEchoReply;
593 IP4Addr = (
IPAddr *)&pEchoReply->Address;
595 SockAddrIn.
sin_addr.S_un.S_addr = *IP4Addr;
609 switch (pEchoReply->Status)
617 if (pEchoReply->RoundTripTime == 0)
625 RTTMin = pEchoReply->RoundTripTime;
628 RTTMax = pEchoReply->RoundTripTime;
630 RTTTotal += pEchoReply->RoundTripTime;
INT WSAAPI GetNameInfoW(IN CONST SOCKADDR *pSockaddr, IN socklen_t SockaddrLength, OUT PWCHAR pNodeBuffer, IN DWORD NodeBufferSize, OUT PWCHAR pServiceBuffer, IN DWORD ServiceBufferSize, IN INT Flags)
INT WSAAPI GetAddrInfoW(IN PCWSTR pszNodeName, IN PCWSTR pszServiceName, IN const ADDRINFOW *ptHints, OUT PADDRINFOW *pptResult)
void ConPuts(FILE *fp, LPCWSTR psz)
#define ConInitStdStreams()
void ConResPrintf(FILE *fp, UINT nID,...)
#define IDS_APPROXIMATE_RTT
#define IDS_REPLY_TIME_0MS
#define IDS_DEST_HOST_UNREACHABLE
#define IDS_REQUEST_TIMED_OUT
#define IDS_TRANSMIT_FAILED
#define IDS_MISSING_ADDRESS
#define IDS_DEST_NET_UNREACHABLE
#define IDS_BAD_PARAMETER
#define IDS_MISSING_VALUE
#define IDS_PINGING_HOSTNAME
#define IDS_REPLY_TIME_MS
#define IDS_PINGING_ADDRESS
#define INVALID_HANDLE_VALUE
BOOL WINAPI IcmpCloseHandle(_In_ HANDLE IcmpHandle)
DWORD WINAPI IcmpSendEcho2(_In_ HANDLE IcmpHandle, _In_opt_ HANDLE Event, _In_opt_ PIO_APC_ROUTINE ApcRoutine, _In_opt_ PVOID ApcContext, _In_ IPAddr DestinationAddress, _In_ LPVOID RequestData, _In_ WORD RequestSize, _In_opt_ PIP_OPTION_INFORMATION RequestOptions, _Out_ LPVOID ReplyBuffer, _In_ DWORD ReplySize, _In_ DWORD Timeout)
HANDLE WINAPI Icmp6CreateFile(void)
HANDLE WINAPI IcmpCreateFile(void)
DWORD WINAPI Icmp6SendEcho2(_In_ HANDLE IcmpHandle, _In_opt_ HANDLE Event, _In_opt_ PIO_APC_ROUTINE ApcRoutine, _In_opt_ PVOID ApcContext, _In_ struct sockaddr_in6 *SourceAddress, _In_ struct sockaddr_in6 *DestinationAddress, _In_ LPVOID RequestData, _In_ WORD RequestSize, _In_ PIP_OPTION_INFORMATION RequestOptions, _Out_ LPVOID ReplyBuffer, _In_ DWORD ReplySize, _In_ DWORD Timeout)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG _Out_writes_bytes_opt_ ReplyLength PVOID ReplyBuffer
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IP_DEST_NET_UNREACHABLE
ICMPV6_ECHO_REPLY_LH ICMPV6_ECHO_REPLY
#define IP_DEST_HOST_UNREACHABLE
struct _IPV6_ADDRESS_EX * PIPV6_ADDRESS_EX
struct icmp_echo_reply * PICMP_ECHO_REPLY
struct icmp_echo_reply ICMP_ECHO_REPLY
#define IP_TTL_EXPIRED_TRANSIT
ICMPV6_ECHO_REPLY_LH * PICMPV6_ECHO_REPLY
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
#define SIZEOF_ICMP_ERROR
#define SIZEOF_IO_STATUS_BLOCK
static BOOL ResolveAddress
static WCHAR CanonName[NI_MAXHOST]
static IP_OPTION_INFORMATION IpOptions
static ULONG EchosSuccessful
static ULONG EchosReceived
static BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType)
static BOOL ParseCmdLine(int argc, PWSTR argv[])
static void PrintStats(void)
INT WSAAPI WSAAddressToStringW(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
namespace GUID const ADDRINFOEXW * hints
unsigned int RoundTripTime
ADDRESS_FAMILY sin6_family
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
static bool ResolveTarget()
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
DWORD WINAPI GetLastError(void)
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)
struct sockaddr_in SOCKADDR_IN
struct sockaddr * PSOCKADDR
SOCKADDR_IN6_LH SOCKADDR_IN6