Reputation: 14281
I want a method of finding out what process opened what port without the aid of an external application. I.e. no netstat or other tools like it.
Upvotes: 0
Views: 175
Reputation: 24477
You need to use the IP helper functions. More specifically GetExtendedTcpTable and GetExtendedUdpTable.
For example, for GetExtendedUdpTable, you can pass in MIB_UDPTABLE_OWNER_PID as the TableClass and you will be able to receive the PID of the process that issued the call to bind for the UDP endpoint.
Upvotes: 2