Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Socket details using PID

Socket details using PID

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anu A Joseph
    wrote on last edited by
    #1

    Is there a way to tie a network connection to a PID (process ID) using Windows Socket functions? I would like to find network connection details associated with a particular process; more specifically in the process, port at which socket is listening and connection state I need to find. Any Windows Socket functions avialable to fetch all these details using VC++? TIA!

    H 1 Reply Last reply
    0
    • A Anu A Joseph

      Is there a way to tie a network connection to a PID (process ID) using Windows Socket functions? I would like to find network connection details associated with a particular process; more specifically in the process, port at which socket is listening and connection state I need to find. Any Windows Socket functions avialable to fetch all these details using VC++? TIA!

      H Offline
      H Offline
      HetzelGJ
      wrote on last edited by
      #2

      It's not part of Winsock, but there is a library that can do what you want. Check out the IP Helper Functions (IpHlpApi). There are calls to fetch the active UDP & TCP listens/connections/etc (GetTcpTable & GetUdpTable). These return information that can be passed to GetOwnerModuleFromTcpEntry, GetOwnerModuleFromUdpEntry. Your best bet is to look up these functions on the msdn site.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups