e.g. recent versions of TCPView has such functionality: showing bytes sent/received per TCP connection (counting starts when TCPView is launched). is it possible w/o packet sniffering? does windows provides any API for this? I haven’t found such Performance Counter
how to enumerate all connections are described here
EDIT: does TDI help to receive per-socket transfer statistics? NetBIOS? any links where to dig?
I want to implement this function also, so I reverse tcpview 3.0.2.
I found, tcpview use a WMI performance counter MSNT_TcpIpInformation.
But MSNT_TcpIpInformation is not supported in xp and 2003 officially.
here is the description, you can reference to.
http://www.scriptinternals.com/new/us/support/Internal/WMI_MSNT_TcpIpInformation.htm
by the way, MSNT_TcpIpInformation have no information about packets, so tcpview just increment sent and revd packets everytime.
here is the disassemble: