TCP/UDP ports and own process...

Hi !

Where can I found a C/C++ source code (with device-drive or not) for
list all TCP/UDP ports and your own processes ?

I found a source code for list in Windows XP only… but dont work with
Windows NT/2000 (only list ports)…
http://www.sysinternals.com/files/netstatp.zip

Any help is welcome…

Thank you

Marcos

IP Helper API's is the ONLY documented way
to get this info and process relationship is available
only on XP. There are a few un documented and
unreliable solutions available on net, do a google for "PortUser"

HTH,

-Farooque Khan

"Marcos Velasco" wrote in message
news:xxxxx@ntdev...
>
> Hi !
>
> Where can I found a C/C++ source code (with device-drive or not) for
> list all TCP/UDP ports and your own processes ?
>
> I found a source code for list in Windows XP only... but dont work with
> Windows NT/2000 (only list ports)...
> http://www.sysinternals.com/files/netstatp.zip
>
> Any help is welcome...
>
> Thank you
>
> Marcos
>
>
>

Hi !

Are you correct ?
“PortUser” in google dont show nothing about TCP/UDP…

Thank you

----- Original Message -----
From: “Farooque Khan”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 18, 2003 9:11 AM
Subject: [ntdev] Re: TCP/UDP ports and own process…

> IP Helper API’s is the ONLY documented way
> to get this info and process relationship is available
> only on XP. There are a few un documented and
> unreliable solutions available on net, do a google for “PortUser”
>
> HTH,
> –
>
> -Farooque Khan
> http://farooque.150m.com
>
>
>
>
> “Marcos Velasco” wrote in message
> news:xxxxx@ntdev…
> >
> > Hi !
> >
> > Where can I found a C/C++ source code (with device-drive or not) for
> > list all TCP/UDP ports and your own processes ?
> >
> > I found a source code for list in Windows XP only… but dont work with
> > Windows NT/2000 (only list ports)…
> > http://www.sysinternals.com/files/netstatp.zip
> >
> > Any help is welcome…
> >
> > Thank you
> >
> > Marcos
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@uol.com.br
> To unsubscribe send a blank email to xxxxx@lists.osr.com

try “Portinuse” in google groups.

-Farooque Khan
http://farooque.150m.com

“Marcos Velasco” wrote in message
news:xxxxx@ntdev…
>
> Hi !
>
> Are you correct ?
> “PortUser” in google dont show nothing about TCP/UDP…
>
> Thank you
>
>
>
> ----- Original Message -----
> From: “Farooque Khan”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Thursday, December 18, 2003 9:11 AM
> Subject: [ntdev] Re: TCP/UDP ports and own process…
>
>
> > IP Helper API’s is the ONLY documented way
> > to get this info and process relationship is available
> > only on XP. There are a few un documented and
> > unreliable solutions available on net, do a google for “PortUser”
> >
> > HTH,
> > –
> >
> > -Farooque Khan
> > http://farooque.150m.com
> >
> >
> >
> >
> > “Marcos Velasco” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > Hi !
> > >
> > > Where can I found a C/C++ source code (with device-drive or not) for
> > > list all TCP/UDP ports and your own processes ?
> > >
> > > I found a source code for list in Windows XP only… but dont work
with
> > > Windows NT/2000 (only list ports)…
> > > http://www.sysinternals.com/files/netstatp.zip
> > >
> > > Any help is welcome…
> > >
> > > Thank you
> > >
> > > Marcos
> > >
> > >
> > >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@uol.com.br
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>

Hi!

I had the same problem. Here’s how I solved it:

Enumerate all handles of type “file” of the particular process (do this in
Ring3). With the handle you get the kernel-object-address. Step into Ring0 and
get the related device-object of that file-object. Check if the
device-object is one of the TDI devices (\Device\Tcp, \Device\Udp). If yes, then query
(TDI_QUERY_INFORMATION) the device for the IP-address and port-number.

That’s it!

Hope that helps.

Hi !

Where can I found a C/C++ source code (with device-drive or not) for
list all TCP/UDP ports and your own processes ?

I found a source code for list in Windows XP only… but dont work with
Windows NT/2000 (only list ports)…
http://www.sysinternals.com/files/netstatp.zip

Any help is welcome…

Thank you

Marcos


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@gmx.de
To unsubscribe send a blank email to xxxxx@lists.osr.com


+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net