Is there any way to programmatically close IPv6 connections using similar approach to this one? There is no SetTcpv6Entry API. Sysinternals TCPView has this option disabled too... Hijacking TCP connection with WFP kernel driver and gracefully sending TCP reset (RST) seems too complex.
MIB_TCPROW sKillConn;
sKillConn.dwLocalAddr = (DWORD)ulLocIP;
sKillConn.dwLocalPort = (DWORD)usLocalPort;
sKillConn.dwRemoteAddr = (DWORD)ulRemIP;
sKillConn.dwRemotePort = (DWORD)usRemPort;
sKillConn.dwState = MIB_TCP_STATE_DELETE_TCB;
DWORD dwRez = SetTcpEntry(&sKillConn);
if(dwRez != NO_ERROR)
{
dwRez = ::GetLastError();
'''