Thanks! I'm aware of the other options (helper service and
PsSetCreateProcessNotify), but I was hoping there was some way to get the
image without having to leave kernel mode (or track anything with the create
process notification callback). Bummer!
I'm a newbie, is there a way to get the PID from the Process Handle (while
in kernel mode)?
Also, can you suggest any books, etc for learning more about the process of
loading an image and creating a process? I already have "Inside MS Windows
2000," and it's a great book! But I'm looking for more detailed information.
And lastly, the purpose of the question is for a tool that I'm working on
for learning more about the internals of Windows - strictly for my own
edification and certainly not for nefarious purposes.
Many Thanks,
Gary
Post by Don BurnThe only documented and safe way of doing this is to use
PsSetLoadImageNotify to capture the path to the executable as the process is
loaded. Using PsSetCreateProcessNotify will allow you to delete paths as
the processes end. There is supposed to be an undocumented call in XP and
later to get the executable path from the process.
Alternatively, pass the pid to a helper service and the service can
determine the process path from user space, and return it to the driver.
Note, it has been discussed many times that trying to use the process path
as a "security feature" is a bad idea (there are too many ways to fake
things). I don't know what you want the name for, but don't try it for
security.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
Post by KernelSandersHello,
I have a kernel driver (for W2K), and it gets a process handle. I would
like to get the image file name (full path to the executable that's
running)
Post by KernelSandersfrom the process handle. Is that possible to obtain?
Thanks!
Gary
--
- Kernel Sanders Kentucky Fried Drivers