INFO: Implementing Internet Pings Using Icmp.dll

Last reviewed: June 25, 1997
Article ID: Q170591
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)

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.

Keywords          : NtwkMisc NtwkTcpip NtwkWinsock
Platform          : NT WINDOWS
Issue type        : kbinfo


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.