How do I go about using the function PsLookupProcessByProcessId() with a process id (DWORD pid) that I obtained from user-space?
I coded a user-space c++ application that gets the process id of another application (calc.exe for example) and using DeviceIoControl I can successfully send to the driver the pid through a struct I created.
DbgPrint("PID received : %i", pInp->pid);
Prints out the correct pid for the process. But when doing:
PsLookupProcessByProcessId(pInp->pid, eProcess);
I receive the warning:
C4022: 'PsLookupProcessByProcessId': pointer mismatch for actual parameter 1
The warning gets treated as an error and vs wont let me compile. I looked up the documentation for 'PsLookupProcessByProcessId' and it says it requires a 'handle' for the first parameter. So, in that case, how would I go about getting the handle with a DWORD pid sent from the user-space application?