https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8e2d1b358c91b7e91fb8a…
commit 8e2d1b358c91b7e91fb8aa093a2e5bb2ee474564
Author: Curtis Wilson <cwilson2016(a)outlook.com>
AuthorDate: Tue Mar 18 17:05:06 2025 -0400
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Mar 18 22:05:06 2025 +0100
[PING] Update SendBuffer fill method (#7782)
The ping utility found in various versions of Windows fills the optional
data field in the ICMP echo request structure with ASCII characters from
'a' to 'w' wrapping back around until SendBuffer is full.
Future TO-DO: Compare ReplyBuffer data to SendBuffer.
---
base/applications/network/ping/ping.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/base/applications/network/ping/ping.c b/base/applications/network/ping/ping.c
index 17afdfc5738..d0ebc0397ae 100644
--- a/base/applications/network/ping/ping.c
+++ b/base/applications/network/ping/ping.c
@@ -432,7 +432,11 @@ Ping(void)
exit(1);
}
- ZeroMemory(SendBuffer, RequestSize);
+ /* Windows ping utility fills the optional data field with
+ * ASCII characters from 'a' to 'w', wrapping back around
+ * until SendBuffer is full. */
+ for (ULONG i = 0; i < RequestSize; i++)
+ ((PUCHAR)SendBuffer)[i] = (UCHAR)('a' + (i % ('w' -
'a' + 1)));
}
if (Family == AF_INET6)
@@ -483,6 +487,7 @@ Ping(void)
ReplyBuffer, ReplySize, Timeout);
}
+ /* TODO: Compare ReplyBuffer data to SendBuffer. */
free(SendBuffer);
if (Status == 0)