Following my post in bug section please find how to use the IcmpSendEcho function with PB 3.94 according with MSDN specification about the ReplyBuffer.
See: http://msdn.microsoft.com/library/defau ... decho.asp.
I hope this is a good help and info...
Code: Select all
EchoMessage.s = "MVPing make a Ping Test"
ResultSize.l = SizeOf(ICMP_ECHO_REPLY) + Len(EchoMessage)
*Result = AllocateMemory(ResultSize)
*Echo.ICMP_ECHO_REPLY = *Result
If OpenConsole()
ConsoleTitle("MVPing")
Repeat
ConsoleColor(15,0)
Print("Adresse IP: ")
ConsoleColor(10,0)
sIPAddress.s = Input()
PrintN("")
If Len(sIPAddress ) > 0
hFile.l = IcmpCreateFile_()
IPAddress.l=MakeIPAddress(Val(StringField(sIPAddress,1,".")),Val(StringField(sIPAddress,2,".")),Val(StringField(sIPAddress,3,".")),Val(StringField(sIPAddress+".",4,".")))
ConsoleColor(14,0)
For Boucle.l = 1 To 4
lngResult.l = IcmpSendEcho_(hFile, IPAddress, EchoMessage, Len(EchoMessage), 0, *Result, ResultSize, 500)
PrintN("Ping " + sIPAddress + " Octets: " + Str(*Echo\DataSize) + " Temps: " + Str(*Echo\RoundTripTime) + " ms TTL:" + StrU(*Echo\Options\Ttl,#PB_Byte))
Delay(500)
Next
IcmpCloseHandle_(hFile)
EndIf
Until sIPAddress= ""
FreeMemory(*Result)
EndIf
End