I would like to determine the process id of the parent process for an arbitrary process in Windows.
I need this method to work on both x64 and x32.
Any ideas / sample code to make this happen. System.Diagnositics.Process does not include this info.
I am a bit worried about using the toolhelp apis cause they are 32 bit specific.
Related info:
- C++ implementation
- Some thing I googled (the interop there is not x64 freindly)
The Performance counter solution in the FAQ: (PerformanceCounter("Process", "Creating Process ID", procName);) scares me, cause it does not allow you to enter a process id, instead you specify a process by name so it all can go pear shape when you have multiple children.