https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8532c3b6f6389bf02648ec...
commit 8532c3b6f6389bf02648ecf0fddf73cfb9a48b5e Author: Serge Gautherie 32623169+SergeGautherie@users.noreply.github.com AuthorDate: Mon Mar 9 19:41:39 2020 +0100 Commit: GitHub noreply@github.com CommitDate: Mon Mar 9 19:41:39 2020 +0100
[PING][TRACERT] Fully support Win64 ICMP_ECHO_REPLY32 (#2427) --- base/applications/network/ping/ping.c | 16 ++++++++++++++++ base/applications/network/tracert/tracert.cpp | 5 +++++ 2 files changed, 21 insertions(+)
diff --git a/base/applications/network/ping/ping.c b/base/applications/network/ping/ping.c index dd1262eac01..435fe03f55b 100644 --- a/base/applications/network/ping/ping.c +++ b/base/applications/network/ping/ping.c @@ -433,9 +433,17 @@ Ping(void) ZeroMemory(SendBuffer, RequestSize);
if (Family == AF_INET6) + { ReplySize += sizeof(ICMPV6_ECHO_REPLY); + } else + { +#ifdef _WIN64 + ReplySize += sizeof(ICMP_ECHO_REPLY32); +#else ReplySize += sizeof(ICMP_ECHO_REPLY); +#endif + }
ReplySize += RequestSize + SIZEOF_ICMP_ERROR + SIZEOF_IO_STATUS_BLOCK;
@@ -566,10 +574,18 @@ Ping(void) } else { +#ifdef _WIN64 + PICMP_ECHO_REPLY32 pEchoReply; +#else PICMP_ECHO_REPLY pEchoReply; +#endif IPAddr *IP4Addr;
+#ifdef _WIN64 + pEchoReply = (PICMP_ECHO_REPLY32)ReplyBuffer; +#else pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer; +#endif
IP4Addr = (IPAddr *)&pEchoReply->Address; SockAddrIn.sin_family = AF_INET; diff --git a/base/applications/network/tracert/tracert.cpp b/base/applications/network/tracert/tracert.cpp index 1cabd0a2dd0..8081a0ada7d 100644 --- a/base/applications/network/tracert/tracert.cpp +++ b/base/applications/network/tracert/tracert.cpp @@ -296,8 +296,13 @@ DecodeResponse( } else { +#ifdef _WIN64 + PICMP_ECHO_REPLY32 EchoReplyV4; + EchoReplyV4 = (PICMP_ECHO_REPLY32)ReplyBuffer; +#else PICMP_ECHO_REPLY EchoReplyV4; EchoReplyV4 = (PICMP_ECHO_REPLY)ReplyBuffer; +#endif Status = EchoReplyV4->Status; RoundTripTime = EchoReplyV4->RoundTripTime; AddressInfo = &EchoReplyV4->Address;