Re: How to get process which send packet in w2k

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 09/13/04


Date: Mon, 13 Sep 2004 12:28:00 -0700

If you read my post again, you should note I warned you explicitly
that this code only works in Win2K. For WinXP use the technique
from netstatp, e.g. AllocateAndGetTcpExTableFromStack.

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Marcin Zajączkowski" <mszpakNO@SPAM.wp.pl> wrote in message 
news:ci17nm$1m73$1@news2.ipartners.pl...
> Dnia 2004-09-10 03:23, Użytkownik Alexander Nickolov napisał:
>> The only source I know of is PortUser.cpp by Gary Nebbett.
>> Check it out in this thread:
>>
>> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=vpkjdugmm8faj0a0mfdt7kcsrcelguc7f1%404ax.com&rnum=1
>>
>> It only works in Win2K, not in NT4, nor XP, and definitely
>> not in any Win9x OSes.
>
> Thanks for answer.
>
> I don't have VS installed currently, so I've tried to compile it with
> MinGW. After few hours I changed this code to compile under it (with two
> warnings):
> portuser.cpp: In function `ULONG
> FindHandle(NT::_SYSTEM_HANDLE_INFORMATION*, long unsigned int, void*)':
> portuser.cpp:324: warning: cast to pointer from integer of different size
> portuser.cpp: In function `void Scan(const Kmem&,
>      NT::_SYSTEM_HANDLE_INFORMATION*, unsigned char, _DEVICE_OBJECT*,
> const CHAR*)':
> portuser.cpp:378: warning: cast to pointer from integer of different size
>
> Unfortunately it crashes in line:
> if (lowmem[pfn * 0x400 + 0x300] == pfn * 0x1000 + 0x67) break;
> in: ULONG Kmem::AnyPde() const.
> I tried in Windows XP, could it be caused by this?
> It's also possible that some my changes caused it (I had problem with
> namespace NT) or MinGW istn't ideal for drivers.
>
> I attached source code, maybe you could tell me what have I done wrong?
> (I hope that server allow small attachment)
>
> Regards
> Marcin
> 


Relevant Pages

  • Re: Confused by const
    ... meow(const char * const *p) ... Why is the call to meowgenerate a warning: ... The rule for pointer ...
    (comp.lang.c)
  • Re: How to get process which send packet in w2k
    ... portuser.cpp:324: warning: cast to pointer from integer of different size ... in: ULONG Kmem::AnyPdeconst. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Write-protecting objects addressed via indirect pointers
    ... how to correctly apply the "const" qualifier, ... is "double-referenced" (pointer to pointer ... say, we have a character array, ... but no cigar: it causes a warning for the function call: ...
    (comp.lang.c)
  • Re: free consted memory without warning?
    ... from pointer target type ... Should I understand from the warning that there's some other way I ... what is the purpose of the "const" in the ... It says that x is a pointer to a read-only object ...
    (comp.lang.c)
  • Re: From Workgroup to Domain
    ... Ok thank you for the help - nice to see the script run:) ... it should help the win2k clients. ... Gibraltar skrev: ... Const JOIN_DOMAIN = 1 ...
    (microsoft.public.windows.server.active_directory)