internal static SafeProcessHandle OpenProcess(Process proc, PROCESS_RIGHTS processRights) { var hProcess = Win32.OpenProcess((int)PROCESS_RIGHTS.PROCESS_ALL_ACCESS, false, proc.Id); int win32Error = Marshal.GetLastWin32Error(); if (hProcess.IsInvalid) { throw new Win32Exception(win32Error, "Couldn't open the process."); } return(hProcess); }
public static extern IntPtr OpenProcess(PROCESS_RIGHTS dwDesiredAccess, bool bInheritHandle, int dwProcessId);
public static extern int OpenProcess(PROCESS_RIGHTS DesiredAccess, int InheritHandle, int ProcessId);
public static extern int OpenProcess(PROCESS_RIGHTS DesiredAccess, int InheritHandle, int ProcessId);
OpenProcess(PROCESS_RIGHTS dwDesiredAccess, bool bInheritHandle, int dwProcessId);
public static extern int OpenProcess(PROCESS_RIGHTS dwDesiredAccess, bool bInheritHandle, int dwProcessId);