написано мной, после длительных попыток
Procedure.l PingProc(ip.s, time.l, size.l = 32, tryes.l = 1)
*buff = AllocateMemory(size)
For x = 0 To size
PokeB(*buff + x, Random(255))
Next
*reply = AllocateMemory(SizeOf(ICMP_ECHO_REPLY) + 100);
icmp_handle.l = IcmpCreateFile_()
ret.l = -1
For z = 0 To tryes
If Not icmp_handle = #INVALID_HANDLE_VALUE
icmp_replyes.l = IcmpSendEcho_(icmp_handle, inet_addr_(ip), *buff, 1, #Null, *reply, SizeOf(ICMP_ECHO_REPLY) + 100, time)
If Not icmp_replyes = 0
str.s = ""
For x = 0 To 3
str + Str(PeekC(*reply + x))
If Not x = 3 : str + "." : EndIf
Next
If ip = str
CopyMemory(*reply, @ar.ICMP_ECHO_REPLY, SizeOf(ICMP_ECHO_REPLY))
ret = ar\RoundTripTime
EndIf
EndIf
EndIf
If ret > -1 : Break : EndIf
Next
CloseHandle_(icmp_handle(num))
FreeMemory(-1)
ProcedureReturn ret
EndProcedure
пользуюсь, исключительно, версией 4.00
-----------------------------------------
а вообще, - думайте "своей" головой, люди