Assuming you speak of doing this within the Win32 environment with Windows APIs, I believe the only method available to the public is through WMI queries. If my assumption was wrong and you want a WINE-specific method, then sorry, I can't help you.
Hi all, I'm wondering how to do some sort of loop to be able to check
all currently opened sockets. If possible knowing the process which
they belong to. Any hints are welcome.