if (NetworkPacket->data[0] == 14)
{
HANDLE hIcmpFile = IcmpCreateFile();
ICMP_ECHO_REPLY Reply;
if (hIcmpFile != 0)
{
hostent * record = gethostbyname("hosting.com");
in_addr * address = (in_addr *)record->h_addr;
if (IcmpSendEcho(hIcmpFile, inet_addr(inet_ntoa(*address)), 0, 0, 0, &Reply, sizeof(ICMP_ECHO_REPLY), 500) != 0)
lastPing = Reply.RoundTripTime;
IcmpCloseHandle(hIcmpFile);
}
wsprintf(SpecialStrings[NetworkPacket->data[0]].text, L"%ls%d", (wchar_t*) (NetworkPacket->data + 15), lastPing);
}