I am looking for the main API calls that netstat -b uses to define ownership processes for each socket. Any ideas?
You need to look at the IPHelper APIs, in this case specifically GetExtendedTcpTable and GetOwnerModuleFromTcpEntry