Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Indy ICMP Client in Windows 10


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Jun 12, 2017 6:08 PM Last Post By: Remy Lebeau (Te...
Bissett Daniel

Posts: 6
Registered: 11/28/07
Indy ICMP Client in Windows 10  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 1:29 PM
I would like to write a program that has the ability to Ping. The only tool for this included with C builder is the Indy ICMP Client. Online, I found a good example of how to use this at www.vclexamples.com. They also have a very concise video on Youtube showing in detail how to build this example. This is exactly what I need. The only problem is that the demo program does not work. Even the the EXE code distributed by www.vclexamples.com does not work. After playing around some, I have discovered that it does work under Windows XP and under Windows 7. It does not work on Windows 10, and presumably Windows 8 also.

Does anyone have any suggestions to get this code to work in Windows 10?

// Running Windows 10 Pro and Berlin 10.1
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Indy ICMP Client in Windows 10  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 2:42 PM   in response to: Bissett Daniel in response to: Bissett Daniel
Bissett Daniel wrote:

I would like to write a program that has the ability to Ping. The
only tool for this included with C builder is the Indy ICMP Client.

That is not true. The Win32 API has its own functions for pinging.
Look at IcmpSendEcho() and related functions.

The only problem is that the demo program does not work. Even the the
EXE code distributed by www.vclexamples.com does not work.

In what way exactly?

After playing around some, I have discovered th at it does work under
Windows XP and under Windows 7. It does not work on Windows 10, and
presumably Windows 8 also.

Are you running the code with elevated privileges? Indy's
TIdIcmpClient component uses a RAW socket, which is restricted to
admins only.

--
Remy Lebeau (TeamB)
Bissett Daniel

Posts: 6
Registered: 11/28/07
Re: Indy ICMP Client in Windows 10  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 3:22 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy,

Thank you for your support and insight. I really appreciate the time you take to help everyone.

You are right. The Indy ICMP client is not the only way to send a ping. But, some ways are more laborious than others.

The Demo uses a try..catch to send the ping. It always catches the exception and the ping is never sent.

I ran the program "As Administrator" under Win 10 and it worked. This is interesting as I recall seeing something about this on the web as being a problem in WinNT and Win2K. It also poses the question why it is not a problem in WinXP and Win7.

Again, thank you for the help.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Indy ICMP Client in Windows 10  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 12, 2017 6:08 PM   in response to: Bissett Daniel in response to: Bissett Daniel
Bissett Daniel wrote:

You are right. The Indy ICMP client is not the only way to send a
ping. But, some ways are more laborious than others.

You think making a single function call is more laborious than using a
whole component?

The Demo uses a try..catch to send the ping.

Because Indy raises exceptions on socket errors.

It always catches the exception

And what does it say?

I ran the program "As Administrator" under Win 10 and it worked.
This is interesting as I recall seeing something about this on the
web as being a problem in WinNT and Win2K. It also poses the
question why it is not a problem in WinXP and Win7.

Because those OS versions are less restrictive than newer OS versions.
RAW sockets can be abused by malicious code, which is why most
platforms (not just Windows) restrict their usage.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02