/* * ThreadPilot - Advanced Windows Process and Power Plan Manager * Copyright (C) 2025 Prime Build * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ namespace ThreadPilot.Platforms.Windows { using System; /// /// Interface for handling CPU Set operations on a specific process. /// public interface IProcessCpuSetHandler : IDisposable { /// /// Gets the process ID this handler manages. /// uint ProcessId { get; } /// /// Gets the executable name. /// string ExecutableName { get; } /// /// Applies a CPU affinity mask to the process using CPU Sets. /// /// The affinity mask where each bit represents a logical processor. /// If true, clears the CPU Set (allows all cores); if false, applies the mask. /// True if the operation succeeded, false otherwise. bool ApplyCpuSetMask(long affinityMask, bool clearMask = false); /// /// Gets the average CPU usage for this process. /// /// CPU usage percentage (0-1 range), or -1 if unavailable. double GetAverageCpuUsage(); /// /// Gets a value indicating whether checks if the handler has valid handles to the process. /// bool IsValid { get; } } }