/// <summary> /// Release / invalidate handle. /// </summary> public static void CloseProcess() { Win32API.CloseHandle(handle); }
/// <summary> /// Get handle to process with read and write permissions. /// </summary> /// <param name="pId">process ID</param> /// <returns>handle</returns> public static IntPtr OpenProcess(int pId) { handle = Win32API.OpenProcess(Win32API.PROCESS_VM_READ | Win32API.PROCESS_VM_WRITE | Win32API.PROCESS_VM_OPERATION, false, pId); return(handle); }