sorry for the late reply, I forgot to check back periodically.
There is already C# code for this on Github: https://github.com/donid/WinKernelObjectsDotNet
This code worked on an older Win10 version, but then suddenly stopped working - it blocks indefinitely when it tries to get some specific handles (or throws exceptions)...
I did extensive research some months ago and it seemed that this is impossible to do reliably in C# since you need some sort of c++ driver.
That was quite a while ago, so I forgot the details. And since processhacker has everything that is needed and it works brilliantly I thought it
would be the a good Idea to make that feature available for C# programmers (which would automatically help Powershell programmers).