i am trying write basic driver for monitor process and get process path.
i create PsSetCreateProcessNotifyRoutine
and retrieve Process information using ZwQueryInformationProcess
but in my ProcessCallback
function when i try to get current process HANDLE
using NtCurrentProcess
, it give me current process that run another process .
For Example:
i try to run myProgram.exe in c:\,when i go to C:\ using windows explorer and run myProgram.exe my driver give me explorer.exe path because myProgram.exe run inside explorer.exe
i have processID in my ProcessCallback header
void ProcessCallback(
IN HANDLE hParentId,
IN HANDLE hProcessId,
IN BOOLEAN bCreate
)
.can i convert it to process handle?