Hackery.ProcessUtils.GetParentProcess C# (CSharp) Method

GetParentProcess() public static method

public static GetParentProcess ( IntPtr handle ) : Process
handle System.IntPtr
return System.Diagnostics.Process
        public static Process GetParentProcess(IntPtr handle)
        {
            ProcessUtils pbi = new ProcessUtils();
            int returnLength;
            int status = NtQueryInformationProcess(handle, 0, ref pbi, Marshal.SizeOf(pbi), out returnLength);
            if (status != 0)
                throw new Win32Exception(status);

            try {
                return Process.GetProcessById(pbi.InheritedFromUniqueProcessId.ToInt32());
            } catch (ArgumentException) {
                // not found
                return null;
            }
        }

Same methods

ProcessUtils::GetParentProcess ( ) : Process
ProcessUtils::GetParentProcess ( int id ) : Process