|
I think we have a counter for it(Im not sure).
|
|
|
|
|
Hi Hamid,
I do not know how to use counter to monitor the port and which process is using the port. Could you more description about your idea please?
regards,
George
|
|
|
|
|
You can use of PdhAddCounter for insert and monitor tcp/ip.
|
|
|
|
|
Hi Hamid!
I think you can use TCPViewer, it is very powerful.
regards,
George
|
|
|
|
|
Thanks ,btw did you see my previous link for read memory adress?
|
|
|
|
|
Yes, Hamid! It needs manually develop some code, and now a quick usable tool is better for me.
regards,
George
|
|
|
|
|
George_George wrote: Any tool could be used to detect which process or module (e.g. DLL) is occupying a specific TCP port?
Use netstat .
This command lists out all opened TCP ports along with the exe's name
netstat -p TCP /b
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Cool Nibu, I can find the port is occupied, but the PID column is displayed as [System], what does it mean?
(BTW: for other items, the exact exe name which is using some port is displayed.)
regards,
George
|
|
|
|
|
George_George wrote: [System], what does it mean?
That's the kernel process ntkrnlpa.exe whose process id is 4. "They" call it System .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Great man, Nibu!
Does it mean the kernel is using that port?
regards,
George
|
|
|
|
|
George_George wrote: Does it mean the kernel is using that port?
Yes!
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Thanks for your help, Nibu!
regards,
George
|
|
|
|
|
Use TcpView[^] from Mark Russinovich.
It's excellent.
You can also find detailed information using the ProcessExplorer[^] regarding loaded dlls and such by double-clicking on a process.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi Roger,
I like TCPView, but does ProcessExplorer have this function to monitor port usage?
regards,
George
|
|
|
|
|
George_George wrote: I like TCPView, but does ProcessExplorer have this function to monitor port usage?
Nope, not in the same way. But you can monitor the connections on the TCP/IP tab in the properties dialogue for a process.
You can also get a lot of information about the process and what dll's is has loaded.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger!
You mean Process Explorer provides process basis view other than global port view?
regards,
George
|
|
|
|
|
George_George wrote: process basis view....global port view
Don't know what you mean.
I meant for you to use TcpView in order to figure out what process has opened which port and then use ProcessExplorer to get more info about the process and its loaded dll's.
Try ProcessExplorer. If you find it useful simply continue to use it, otherwise throw it in the trash can.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger,
Sorry for my bad English. Let me say in question in some other words. Could you point out under which menu could we have port usage of a process under Process Explorer please? I have tried but failed to find out.
regards,
George
|
|
|
|
|
<Process> -> <Properties>...or
right click for context menu on a process in the tree and then select <Properties>...or
double-clicking on a process in the tree...
...will bring up the tabbed properties dialogue box.
Select the TCP/IP tab and you'll see what ports the process currently has opened.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger,
I can see 4 columns, they are protocol/Local Address/Remote Address/State. Do you mean the port in Local Address are the occupied address?
regards,
George
|
|
|
|
|
The address columns show either an ip-address or a resolved host name followed by a colon and a number. The number after the colon is the port used.
The local address column is on you computer and the remote column is the remote computer that your computer connects to.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks Roger!
Question answered.
regards,
George
|
|
|
|
|
Hi,
How to read a manifest file from executable using either vc++ or sdk?
Regards
|
|
|
|
|
What's a manifest file?
Do you mean a .NET assembly manifest? If so, it's XML - you can
read it the same way you'd read any XML file.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
There is manifest file for native applications also. It can either be embedded in the executable file or can be used as standalong file. It basically points to which version of CRT, MFC, and other common controls to use from winsxs.
-Saurabh
|
|
|
|