public static IntPtr OpenProcess(int processid, NativeEnums.ProcessAccess flags) { IntPtr hProcess = NativeMethods.OpenProcess((uint)flags, false, (uint)processid); if (hProcess == IntPtr.Zero) { throw new Win32Exception(); } return(hProcess); }
public static IntPtr OpenProcess(Process process, NativeEnums.ProcessAccess flags) { return(OpenProcess(process.Id, flags)); }