Page 1 of 1

get process by function

Posted: Sat Jun 26, 2004 7:53 pm
by anAKiN
Hi!
I'm just wondering if it would be possible to get pid of the process that calls hooked by my application function. For example if i hook 'send' from WinSock i would like to know that it was orginally called by some pid, that i would use to get 'explorer.exe' for example.

Thanks in advance,
anAKiN

Posted: Sat Jun 26, 2004 8:33 pm
by madshi
Sure, just call GetCurrentProcessID to get the PID of the current process or call GetModuleFileName(0, ...) to get the name of the exe which called the hooked API! :idea:

Posted: Sat Jun 26, 2004 8:38 pm
by anAKiN
hmm, right... forgot i have to use dll, so that i can use these functions ;-)
thanks!