It looks like you've found and are using an old VB6 definition of the structures, not compatibile with VB.NET. A 32-bit integer is called Integer in VB.NET, not Long. That was the old VB6 name for it. Long under VB.NET is a 64-bit integer. If you don't get this correct, you can imbalence the call stack. The function declaration should be this:
Declare Function Auto GetTcpTable Lib "IPhlpAPI.dll" ( _
ByVal pTcpTable As MIB_TCPTABLE, _
ByVal pdwSize As Integer, _
ByVal bOrder As Boolean) As Integer
Dave Kreskowiak Microsoft MVP - Visual Basic