0

Is there a kernel mode version of OpenProcess function?

Basically I want to get a process HANDLE from process ID. Specifically, I want to get the HANDLE of System Process ID.

Thanks!

Brex
  • 3
  • 3
  • I think you looking for [This](https://stackoverflow.com/questions/2221103/how-to-get-process-handle-from-process-id) – ntshetty Dec 05 '17 at 07:04
  • Thank you for that but correct if I'm wrong but I think that won't work in developing windows driver. – Brex Dec 05 '17 at 07:14

1 Answers1

0

If you are in an arbitrary system thread you can use ZwCurrentProcess(), otherwise you will need to figure out the ID of a system thread somehow and use ZwOpenProcess.

You might also look to see if there is a way to convert the result of PsInitialSystemProcess to a process handle (or maybe PsInitialSystemProcess is what you are really after).

SoronelHaetir
  • 14,104
  • 1
  • 12
  • 23