INFO: Implementing Internet Pings Using Icmp.dll

ID: Q170591

The information in this article applies to:

SUMMARY

Icmp.dll provides functionality that allows developers to write Internet ping applications on Windows systems without Winsock 2 support. The .h and .lib files needed in order to use Icmp.dll were provided with previous versions of Win 32 SDK in the MSTOOLS\ICMP directory. The current Platform SDK release includes only the icmp.lib file. A Readme.txt (copied below) and the .h files from previous versions of the Win 32 SDK were, and still are, the only documentation available.

If you are writing new code intended for platforms that support Winsock 2.0 or better, you should use the Winsock 2 raw sockets support demonstrated in the Platform SDK sample titled "Ping: SOCK_RAW in Winsock 2.0" available in MSSDK\samples\win32\winsock2\ping. As noted in the Readme.txt, Icmp.dll may be removed from future versions of Windows.

Support of Icmp.dll is limited to providing the information in this article and the .h files that accompany Icmp.dll.

Note that the Winsock 1.1 WSAStartup function must be called prior to using the functions exposed by ICMP.DLL. If you do not do this, the first call to IcmpSendEcho will fail with error 10091 (WSASYSNOTREADY).

------------ ICMP README.TXT --------------- [DISCLAIMER]

We have had requests in the past to expose the functions exported from icmp.dll. The files in this directory are provided for your convenience in building applications which make use of ICMPSendEcho().

Notice that the functions in icmp.dll are not considered part of the Win32 API and will not be supported in future releases. Once we have a more complete solution in the operating system, this DLL, and the functions it exports, will be dropped.

[DOCUMENTATION]

The ICMPSendEcho() function sends an ICMP echo request to the specified destination IP address and returns any replies received within the timeout specified. The API is synchronous, requiring the process to spawn a thread before calling the API to avoid blocking. An open IcmpHandle is required for the request to complete. IcmpCreateFile() and IcmpCloseHandle() functions are used to create and destroy the context handle.

See also icmpapi.h.

Additional query words:

Keywords          : kbnetwork kbIP kbNTOS kbSDKPlatform kbWinsock kbGrpNet 
Issue type        : kbinfo

Last Reviewed: July 31, 1998