how to get process id for a connection under w2k environment



Hi Guys,

I've tried netstat on winxp and w2k3 server and notice that there is a
'-o' feature which enables the process id along with a connection. I
wonder if I can do the same thing in w2k as well.

(1) It seems to me that, there is a function
'AllocateAndGetTcpExTableFromStack' which gets the process id
information, but I couldn't find it in msdn though. Most likely w2k
doesn't support this function. Is that right??


(2) Also, I've tried the portuser.cpp,
http://groups-beta.google.com/group/microsoft.public.win32.programmer.networks/msg/2fd169a4dce10c4?as_umsgid=vpkjdugmm8faj0a0mfdt7kcsrcelguc7f1@xxxxxxx
but I couldn't make it to work, with the following errors.

// this happened if I've included ntdll.lib. If I take ntdll.lib out,
there will be a missing function __imp__ZwOpenSection@12, which I think
is even worst.
Linking...
LIBC.lib(exsup.obj) : error LNK2005: __global_unwind2 already defined
in ntdll.lib(exsup.obj)
LIBC.lib(exsup.obj) : error LNK2005: __local_unwind2 already defined in
ntdll.lib(exsup.obj)
LIBC.lib(exsup.obj) : error LNK2005: __abnormal_termination already
defined in ntdll.lib(exsup.obj)
LIBC.lib(output.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4
LIBC.lib(mbctype.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4
LIBC.lib(write.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4
LIBC.lib(convrtcp.obj) : error LNK2001: unresolved external symbol
@__security_check_cookie@4

Or, are there any methods to get the same solution as well?
Please give me some advance, thank you very much.

wk_fung

.


Loading