コード例 #1
0
ファイル: ProcessUtils.cs プロジェクト: cartman300/Hackery
        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;
            }
        }
コード例 #2
0
ファイル: ProcessUtils.cs プロジェクト: cartman300/Hackery
 private static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, ref ProcessUtils processInformation, int processInformationLength, out int returnLength);
コード例 #3
0
ファイル: ProcessUtils.cs プロジェクト: sbarisic/Hackery
 private static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, ref ProcessUtils processInformation, int processInformationLength, out int returnLength);