Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[need-help] Win32 Api for enum all open Port?

Featured Replies

Posted

Hi All.

I need some Win32 Api functions for enum all open port (TCP, UDP, etc) that can be implemented on XP, 7, or below. is there any function that i can be used for?

create tcp stream socket & try to connect() to it. Do that for all the ports in your range.

I dont really see any other way...

You can use the IP helper library that is part of Windows, see this MSDN link:
/>http://msdn.microsoft.com/en-us/library/windows/desktop/aa366071%28v=vs.85%29.aspx

create tcp stream socket & try to connect() to it. Do that for all the ports in your range.

I dont really see any other way...

trying to connect() to every possible existing port inside a loop is not a smart way....

i'm with kao, GetTcpTable / GetExtendedTcpTable.

Edited by rotem156

http://www.codeproject.com/Articles/5453/Enhance-netstat

The main idea of this project was already implemented and presented by some guys around here: using GetTcpTable and GetUdpTable to read connection states of running processes. Yet another thing that is mentioned in this kind of articles are two undocumented APIs from iphlpapi.dll: AllocateAndGetTcpExTableFromStack and AllocateAndGetUdpExTableFromStack. Using these APIs, we can get access to the name of the process that holds the running connection. Unfortunately it does work only with Win2000, WinXP or newer versions.

Amazing what happens if you actually perform a Google search for something relating to this subject, like: "Detect open ports C++"

HR,

Ghandi

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.