If you are developing ICMP multithread application, you may notice private bytes growing steadily and constantly when running on post-Vista OS, including Vista, Window Server 2008 and Windows 7.
For example:
int _tmain(int argc, _TCHAR* argv[])
{
while(true){
_beginthread(SendPing, 0, NULL);
Sleep(50);
}
return 0;
}
void SendPing(LPVOID lpParameter)
{
HANDLE hIcmpFile; // Handle for ICMP echo requests
BOOL bRetVal;
hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
//Print message
}
else
{
// close the echo request file handle
bRetVal = IcmpCloseHandle(hIcmpFile);
if(bRetVal)
{
//print message
}
else
{
//print message
}
}
_endthread();
}