mirror of
https://github.com/reactos/reactos.git
synced 2026-05-23 07:40:09 +08:00
[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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user