Func _DisableConnection($lIP,$lP,$rIP,$rP)
$hIPHLPAPI = DllOpen("iphlpapi.dll")
Local $tMIB_TCPROW = DllStructCreate("dword State;" & _
"dword LocalAddr;" & _
"dword LocalPort;" & _
"dword RemoteAddr;" & _
"dword RemotePort")
DllStructSetData($tMIB_TCPROW, "State", 12) ; MIB_TCP_STATE_DELETE_TCB
Local $aIPLocal = StringSplit($lIP, ".")
$iIPLocal = Dec(Hex($aIPLocal[4], 2) & Hex($aIPLocal[3], 2) & Hex($aIPLocal[2], 2) & Hex($aIPLocal[1], 2))
DllStructSetData($tMIB_TCPROW, "LocalAddr", $iIPLocal)
$iPortLocal = Dec(Hex(BinaryMid(Number($lP), 1, 2)))
;~ $iPortLocal ='0'
DllStructSetData($tMIB_TCPROW, "LocalPort", $iPortLocal)
Local $aIPRemote = StringSplit($rIP, ".")
$iIPRemote = Dec(Hex($aIPRemote[4], 2) & Hex($aIPRemote[3], 2) & Hex($aIPRemote[2], 2) & Hex($aIPRemote[1], 2))
DllStructSetData($tMIB_TCPROW, "RemoteAddr", $iIPRemote)
Local $aPortRemote = StringRegExp($rP, "\A\d{1,5}", 3)
$iPortRemote = Dec(Hex(BinaryMid(Number($aPortRemote[0]), 1, 2)))
DllStructSetData($tMIB_TCPROW, "RemotePort", $iPortRemote)
Local $aCall = DllCall($hIPHLPAPI, "int", "SetTcpEntry", "ptr", DllStructGetPtr($tMIB_TCPROW))
If @error Or $aCall[0] Then
Return SetError(2, 0, 0)
EndIf
Return 1
EndFunc ;==>_DisableConnection