Prepare ThreadPilot 1.7.0 gaming and signing release (#51)
This commit is contained in:
@@ -66,13 +66,6 @@ jobs:
|
||||
- name: Publish self-contained single-file
|
||||
run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-SingleFile
|
||||
|
||||
- name: Ensure bundled power plans in single-file output
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
New-Item -ItemType Directory -Force -Path "artifacts/release/singlefile/Powerplans" | Out-Null
|
||||
Copy-Item "assets/Powerplans/*" -Destination "artifacts/release/singlefile/Powerplans" -Recurse -Force
|
||||
|
||||
- name: Publish ReadyToRun
|
||||
run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-ReadyToRun
|
||||
|
||||
@@ -158,6 +151,7 @@ jobs:
|
||||
taskkill /IM "ThreadPilot.exe" /F >nul 2>&1
|
||||
|
||||
echo [2/4] Removing startup task and startup registry entry...
|
||||
schtasks /Delete /TN "ThreadPilot_Launch" /F >nul 2>&1
|
||||
schtasks /Delete /TN "ThreadPilot_Startup" /F >nul 2>&1
|
||||
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "ThreadPilot" /f >nul 2>&1
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define MyAppPublisher "ThreadPilot"
|
||||
#define MyAppURL "https://github.com/"
|
||||
#define MyAppExeName "ThreadPilot.exe"
|
||||
#define MyAppVersion "1.6.0"
|
||||
#define MyAppVersion "1.7.0"
|
||||
|
||||
#ifndef MyWizardStyle
|
||||
#define MyWizardStyle "modern dynamic windows11"
|
||||
@@ -55,6 +55,7 @@ Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChang
|
||||
|
||||
[UninstallRun]
|
||||
Filename: "taskkill.exe"; Parameters: "/IM ""{#MyAppExeName}"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallKill"
|
||||
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Launch"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotLaunchTask"
|
||||
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Startup"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotStartupTask"
|
||||
Filename: "reg.exe"; Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""ThreadPilot"" /f"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotRunEntry"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<Package
|
||||
Name="ThreadPilot"
|
||||
Manufacturer="Prime Build"
|
||||
Version="1.6.0.0"
|
||||
Version="1.7.0.0"
|
||||
UpgradeCode="PUT-GENERATED-UPGRADE-CODE-HERE"
|
||||
Language="1033">
|
||||
<SummaryInformation Description="ThreadPilot MSI template" />
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef MyAppVersion
|
||||
#define MyAppVersion "1.6.0"
|
||||
#define MyAppVersion "1.7.0"
|
||||
#endif
|
||||
|
||||
#ifndef MyAppSourceDir
|
||||
@@ -54,7 +54,6 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
|
||||
Source: "{#MyAppSourceDir}\ThreadPilot.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "{#MyAppSourceDir}\*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
|
||||
Source: "{#MyAppSourceDir}\*.pdb"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist
|
||||
Source: "{#MyAppSourceDir}\Powerplans\*"; DestDir: "{app}\Powerplans"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
@@ -71,6 +70,7 @@ Filename: "{app}\{#MyAppExeName}"; Flags: nowait; Check: IsThreadPilotUpdate
|
||||
; Per-user AppData cleanup is limited to the account context used by uninstall.
|
||||
[UninstallRun]
|
||||
Filename: "taskkill.exe"; Parameters: "/IM ""{#MyAppExeName}"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallKillThreadPilot"
|
||||
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Launch"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotLaunchTask"
|
||||
Filename: "schtasks.exe"; Parameters: "/Delete /TN ""ThreadPilot_Startup"" /F"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotStartupTask"
|
||||
Filename: "reg.exe"; Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""ThreadPilot"" /f"; Flags: runhidden waituntilterminated; RunOnceId: "UninstallRemoveThreadPilotRunEntry"
|
||||
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Importieren Sie die ausgewählte benutzerdefinierte .pow-Datei in Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">.pow-Datei hinzufügen</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Fügen Sie der benutzerdefinierten Bibliothek eine neue benutzerdefinierte Energieplandatei hinzu</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">Mehr Energiesparpläne?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Weitere Energiesparpläne der Community auf Discord entdecken.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Löschen</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Aktiv</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">Die Echtzeitpriorität wird von ThreadPilot blockiert, da Windows dadurch instabil werden oder nicht mehr reagieren kann.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">Echtzeit (blockiert)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Deaktivieren Sie den inaktiven Server</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Verhindert, dass das System während der Ausführung dieses Prozesses in den Ruhezustand wechselt. Nützlich für Spiele und leistungskritische Anwendungen.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Ruhezustand während des Prozesses verhindern</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Hält das System aktiv, solange der Prozess läuft. Der Bildschirm darf ausgehen und expliziter Ruhezustand wird nicht blockiert.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Profil / Regel</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Geben Sie einen Profilnamen ein, um Einstellungen zu speichern oder zu laden</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Regeln</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Name</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Legen Sie die Speicherpriorität fest</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">E/A-Priorität festlegen</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">E/A-Priorität nicht verfügbar</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">E/A-Priorität: {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Sehr niedrig</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Mittel</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Prozessinformationen aktualisieren</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Aktivieren Sie die Debug-Protokollierung</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Leistungsindikatoren aktivieren</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">Stimmt etwas nicht?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Tritt der ThreadPilot-Discord-Community bei, um Hilfe zu erhalten und dich auszutauschen.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Discord öffnen</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Melde Fehler oder unerwartetes Verhalten über GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Problem melden</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">Über</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Version:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">Copyright © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">Hohe Planungspriorität für Gaming-Anwendungen</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Menü Verzögerung anzeigen</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Verzögerung vor der Anzeige von Kontextmenüs</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Spielmodus</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Planungsoptimierungen des Windows-Spielmodus</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Speicherintegrität (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Öffnet Windows-Sicherheit. Das Deaktivieren verringert die Systemsicherheit und kann einen Neustart erfordern.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Hardwarebeschleunigte GPU-Planung</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Öffnet die Windows-Grafikeinstellungen zur Prüfung von HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Optimierungen für Fensterspiele</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Öffnet die Windows-Grafikeinstellungen für Flip-Model-Optimierungen.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">Selektives USB-Energiesparen</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Steuert selektives USB-Energiesparen im aktiven Netzstromplan.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Zeigerbeschleunigung</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Steuert die Windows-Mausbeschleunigung.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Ethernet-Energiesparen deaktivieren</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Deaktiviert unterstützte EEE-, Green-Ethernet- und Energiesparoptionen physischer Ethernet-Adapter.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Interrupt-Moderation deaktivieren</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Kann die Ethernet-Latenz auf Kosten höherer CPU- und Interrupt-Last senken.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">GPU-MSI-Modus</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Steuert MSI nur, wenn der Grafiktreiber MSISupported bereits bereitstellt. Neustart erforderlich.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Einstellungen öffnen</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Von Windows verwaltet</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">Windows-Einstellungen konnten nicht geöffnet werden</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Einstellungen für {0} geöffnet</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Bereit</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Import the selected custom .pow file into Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">Add .pow File</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Add a new custom power plan file to the custom library</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">More plans?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Browse additional community power plans on Discord.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Delete</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Active</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">Realtime priority is blocked by ThreadPilot because it can make Windows unstable or unresponsive.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">Realtime (blocked)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Disable Idle Server</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Prevents the system from entering idle state while this process is running. Useful for games and performance-critical applications.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Prevent sleep while process runs</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Keeps the system awake while this process is running. The display may still turn off, and explicit sleep is not blocked.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Profile / Rule</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Enter a profile name to save or load settings</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Rules</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Name</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Set Memory Priority</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">Set I/O Priority</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">I/O priority unavailable</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">I/O priority: {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Very Low</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Medium</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Refresh Process Info</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Enable debug logging</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Enable performance counters</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">Something wrong?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Join the ThreadPilot Discord community for help and discussion.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Open Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Report bugs or unexpected behavior through GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Report an issue</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">About</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Version:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">Copyright © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">High scheduling priority for gaming applications</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Menu Show Delay</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Delay before showing context menus</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Game Mode</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Windows Game Mode scheduling optimizations</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Memory Integrity (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Opens Windows Security. Disabling this protection reduces system security and may require a restart.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Hardware-accelerated GPU scheduling</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Opens Windows graphics settings to let you review HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Optimizations for windowed games</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Opens Windows graphics settings to manage Flip Model optimizations.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">USB Selective Suspend</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Controls USB selective suspend for the active power plan while plugged in.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Enhance pointer precision</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Controls Windows mouse acceleration.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Disable Ethernet power saving</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Disables supported EEE, Green Ethernet and power-saving driver properties on physical Ethernet adapters.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Disable interrupt moderation</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Can reduce Ethernet latency at the cost of higher CPU and interrupt load.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">GPU MSI Mode</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Controls MSI only when the display driver already exposes MSISupported. A restart is required.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Open settings</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Managed by Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">Could not open Windows settings</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Opened settings for {0}</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Ready</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Importe el archivo .pow personalizado seleccionado a Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">Agregar archivo .pow</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Agregue un nuevo archivo de plan de energía personalizado a la biblioteca personalizada</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">¿Más planes?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Descubre más planes de energía de la comunidad en Discord.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Eliminar</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Activo</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">La prioridad en tiempo real está bloqueada por ThreadPilot porque puede hacer que Windows sea inestable o no responda.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">Tiempo real (bloqueado)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Deshabilitar el servidor inactivo</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Evita que el sistema entre en estado inactivo mientras se ejecuta este proceso. Útil para juegos y aplicaciones críticas para el rendimiento.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Evitar suspensión durante el proceso</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Mantiene el sistema activo mientras se ejecuta el proceso. La pantalla puede apagarse y no se bloquea una suspensión explícita.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Perfil / Regla</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Ingrese un nombre de perfil para guardar o cargar la configuración</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Reglas</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Nombre</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Establecer prioridad de memoria</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">Establecer prioridad de E/S</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">Prioridad de E/S no disponible</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">Prioridad de E/S: {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Muy bajo</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Medio</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Actualizar información del proceso</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Habilitar el registro de depuración</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Habilitar contadores de rendimiento</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">¿Algo no funciona?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Únete a la comunidad de ThreadPilot en Discord para obtener ayuda y conversar.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Abrir Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Informa de errores o comportamientos inesperados mediante GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Informar de un problema</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">Acerca de</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Versión:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">Copyright © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">Alta prioridad de programación para aplicaciones de juegos</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Menú Mostrar retraso</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Retraso antes de mostrar menús contextuales</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Modo de juego</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Optimizaciones de programación del Modo de juego de Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Integridad de memoria (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Abre Seguridad de Windows. Desactivarla reduce la seguridad y puede requerir reiniciar.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Programación de GPU acelerada por hardware</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Abre la configuración gráfica de Windows para revisar HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Optimizaciones para juegos en ventana</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Abre la configuración gráfica de Windows para administrar Flip Model.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">Suspensión selectiva USB</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Controla la suspensión selectiva USB del plan activo cuando está conectado.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Mejorar precisión del puntero</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Controla la aceleración del ratón de Windows.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Desactivar ahorro de energía Ethernet</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Desactiva EEE, Green Ethernet y opciones compatibles en adaptadores Ethernet físicos.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Desactivar moderación de interrupciones</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Puede reducir la latencia Ethernet aumentando la carga de CPU e interrupciones.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">Modo MSI de GPU</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Controla MSI solo si el controlador gráfico ya expone MSISupported. Requiere reiniciar.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Abrir configuración</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Administrado por Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">No se pudo abrir la configuración de Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Configuración abierta para {0}</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Listo</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Importez le fichier .pow personnalisé sélectionné dans Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">Ajouter un fichier .pow</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Ajouter un nouveau fichier de plan d'alimentation personnalisé à la bibliothèque personnalisée</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">Plus de modes ?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Découvrez d'autres modes d'alimentation de la communauté sur Discord.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Supprimer</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Actif</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">La priorité en temps réel est bloquée par ThreadPilot car elle peut rendre Windows instable ou ne pas répondre.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">Temps réel (bloqué)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Désactiver le serveur inactif</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Empêche le système d'entrer en état d'inactivité pendant l'exécution de ce processus. Utile pour les jeux et les applications critiques en termes de performances.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Empêcher la veille pendant le processus</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Maintient le système éveillé pendant l'exécution du processus. L'écran peut s'éteindre et une veille explicite n'est pas bloquée.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Profil / Règle</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Entrez un nom de profil pour enregistrer ou charger les paramètres</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Règles</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Nom</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Définir la priorité de la mémoire</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">Définir la priorité E/S</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">Priorité E/S indisponible</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">Priorité E/S : {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Très faible</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Moyen</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Actualiser les informations sur le processus</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Activer la journalisation du débogage</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Activer les compteurs de performances</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">Un problème ?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Rejoignez la communauté Discord de ThreadPilot pour obtenir de l'aide et échanger.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Ouvrir Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Signalez les bugs ou comportements inattendus via GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Signaler un problème</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">À propos</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Version :</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">Copyright © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">Priorité de planification élevée pour les applications de jeux</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Menu Afficher le délai</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Délai avant l'affichage des menus contextuels</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Mode Jeu</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Optimisations de planification du Mode Jeu Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Intégrité de la mémoire (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Ouvre Sécurité Windows. La désactivation réduit la sécurité et peut nécessiter un redémarrage.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Planification GPU à accélération matérielle</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Ouvre les paramètres graphiques Windows pour vérifier HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Optimisations des jeux fenêtrés</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Ouvre les paramètres graphiques Windows pour gérer les optimisations Flip Model.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">Suspension sélective USB</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Contrôle la suspension sélective USB du mode d'alimentation actif sur secteur.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Améliorer la précision du pointeur</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Contrôle l'accélération de la souris Windows.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Désactiver l'économie d'énergie Ethernet</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Désactive EEE, Green Ethernet et les options d'économie prises en charge sur les adaptateurs Ethernet physiques.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Désactiver la modération des interruptions</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Peut réduire la latence Ethernet au prix d'une charge CPU et d'interruptions supérieure.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">Mode MSI du GPU</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Contrôle MSI uniquement si le pilote graphique expose déjà MSISupported. Redémarrage requis.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Ouvrir les paramètres</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Géré par Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">Impossible d'ouvrir les paramètres Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Paramètres ouverts pour {0}</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Prêt</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Importa il file .pow personalizzato selezionato in Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">Aggiungi il file .pow</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Aggiungi un nuovo file di combinazione di risparmio energia personalizzato alla libreria personalizzata</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">Altri piani?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Scopri altri piani energetici della community su Discord.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Elimina</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Attivo</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">La priorità in tempo reale è bloccata da ThreadPilot perché può rendere Windows instabile o non rispondere.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">In tempo reale (bloccato)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Disabilita server inattivo</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Impedisce al sistema di entrare nello stato inattivo mentre questo processo è in esecuzione. Utile per giochi e applicazioni critiche per le prestazioni.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Impedisci sospensione durante il processo</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Mantiene attivo il sistema finché il processo è in esecuzione. Lo schermo può spegnersi e la sospensione richiesta dall'utente non viene bloccata.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Profilo/Regola</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Inserisci un nome di profilo per salvare o caricare le impostazioni</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Regole</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Nome</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Imposta la priorità della memoria</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">Imposta priorità I/O</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">Priorità I/O non disponibile</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">Priorità I/O: {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Molto basso</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Medio</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Aggiorna informazioni sul processo</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Abilita la registrazione del debug</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Abilita i contatori delle prestazioni</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">Qualcosa non va?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Entra nella community Discord di ThreadPilot per assistenza e discussioni.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Apri Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Segnala bug o comportamenti anomali tramite GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Segnala un problema</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">Informazioni</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Versione:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">Copyright © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">Alta priorità di pianificazione per le applicazioni di gioco</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Menu Mostra ritardo</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Ritardo prima di mostrare i menu contestuali</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Modalità gioco</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Ottimizzazioni di pianificazione della Modalità gioco di Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Integrità della memoria (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Apre Sicurezza di Windows. Disattivare questa protezione riduce la sicurezza e può richiedere il riavvio.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Pianificazione GPU con accelerazione hardware</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Apre le impostazioni grafiche di Windows per controllare HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Ottimizzazioni per giochi in finestra</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Apre le impostazioni grafiche di Windows per gestire le ottimizzazioni Flip Model.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">Sospensione selettiva USB</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Controlla la sospensione selettiva USB del piano attivo quando il PC è collegato alla rete elettrica.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Aumenta precisione puntatore</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Controlla l'accelerazione del mouse di Windows.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Disattiva risparmio energetico Ethernet</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Disattiva EEE, Green Ethernet e le proprietà di risparmio energetico supportate sugli adattatori Ethernet fisici.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Disattiva moderazione interrupt</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Può ridurre la latenza Ethernet aumentando il carico CPU e il numero di interrupt.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">Modalità MSI GPU</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Controlla MSI solo se il driver video espone già MSISupported. È necessario riavviare.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Apri impostazioni</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Gestito da Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">Impossibile aprire le impostazioni di Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Impostazioni aperte per {0}</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Pronto</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">Импортируйте выбранный пользовательский файл .pow в Windows.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">Добавить файл .pow</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">Добавьте новый файл пользовательского плана электропитания в пользовательскую библиотеку.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">Нужны другие планы?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">Найдите дополнительные планы электропитания сообщества в Discord.</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">Удалить</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">Активный</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">Приоритет реального времени блокируется ThreadPilot, поскольку это может сделать Windows нестабильным или перестать отвечать на запросы.</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">В реальном времени (заблокировано)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Отключить простаивающий сервер</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Предотвращает переход системы в состояние ожидания во время выполнения этого процесса. Полезно для игр и приложений, критичных к производительности.</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">Не переходить в сон во время процесса</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">Поддерживает работу системы, пока процесс запущен. Экран может выключиться, а явный переход в сон не блокируется.</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">Профиль/Правило</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">Введите имя профиля, чтобы сохранить или загрузить настройки.</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">Правила</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">Имя</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">Установить приоритет памяти</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">Установить приоритет ввода-вывода</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">Приоритет ввода-вывода недоступен</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">Приоритет ввода-вывода: {0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">Очень низкий</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">Средний</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">Обновить информацию о процессе</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">Включить ведение журнала отладки</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">Включить счетчики производительности</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">Что-то не работает?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">Присоединяйтесь к сообществу ThreadPilot в Discord для помощи и общения.</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">Открыть Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">Сообщайте об ошибках и неожиданном поведении через GitHub Issues.</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">Сообщить о проблеме</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">О</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">Версия:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">© 2026 PrimeBuild.</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">Высокий приоритет планирования для игровых приложений</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">Задержка показа меню</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">Задержка перед показом контекстных меню</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">Игровой режим</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Оптимизации планирования игрового режима Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">Целостность памяти (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">Открывает Безопасность Windows. Отключение снижает безопасность и может потребовать перезагрузки.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">Аппаратное планирование GPU</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">Открывает параметры графики Windows для проверки HAGS.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">Оптимизация оконных игр</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">Открывает параметры графики Windows для управления Flip Model.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">Выборочная приостановка USB</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">Управляет приостановкой USB в активном плане при питании от сети.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">Повышенная точность указателя</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">Управляет ускорением мыши Windows.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">Отключить энергосбережение Ethernet</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">Отключает поддерживаемые EEE, Green Ethernet и энергосбережение физических Ethernet-адаптеров.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">Отключить модерацию прерываний</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">Может снизить задержку Ethernet ценой повышенной нагрузки CPU и прерываний.</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">Режим MSI для GPU</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">Управляет MSI, только если видеодрайвер уже предоставляет MSISupported. Требуется перезагрузка.</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">Открыть параметры</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">Управляется Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">Не удалось открыть параметры Windows</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">Открыты параметры для {0}</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">Готово</sys:String>
|
||||
|
||||
+34
-2
@@ -172,6 +172,8 @@
|
||||
<sys:String x:Key="PowerPlanView_ImportSelectedTooltip">将所选的自定义 .pow 文件导入 Windows</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFile">添加 .pow 文件</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_AddFileTooltip">向自定义库添加新的自定义电源计划文件</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlans">需要更多计划?</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_MorePlansTooltip">在 Discord 中获取更多社区电源计划。</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Delete">删除</sys:String>
|
||||
<sys:String x:Key="PowerPlanView_Active">活动</sys:String>
|
||||
|
||||
@@ -278,8 +280,8 @@
|
||||
<sys:String x:Key="ProcessView_RealtimeBlockedHelp">实时优先级已被 ThreadPilot 阻止,因为它可能会使 Windows 不稳定或无响应。</sys:String>
|
||||
<sys:String x:Key="ProcessView_RealtimeBlocked">实时 (已阻止)</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">禁用空闲服务</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">在此进程运行时阻止系统进入空闲状态。适用于游戏和对性能要求严苛的应用程序。</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServer">进程运行时阻止睡眠</sys:String>
|
||||
<sys:String x:Key="ProcessView_DisableIdleServerTooltip">进程运行时保持系统唤醒。显示器仍可关闭,并且不会阻止用户明确请求的睡眠。</sys:String>
|
||||
|
||||
<sys:String x:Key="ProcessView_ProfileRule">配置文件 / 规则</sys:String>
|
||||
<sys:String x:Key="ProcessView_ProfileNamePlaceholder">输入配置文件名称以保存或加载设置</sys:String>
|
||||
@@ -365,6 +367,9 @@
|
||||
<sys:String x:Key="ProcessView_Rules">规则</sys:String>
|
||||
<sys:String x:Key="ProcessView_Name">名称</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetMemoryPriority">设置内存优先级</sys:String>
|
||||
<sys:String x:Key="ProcessView_SetIoPriority">设置 I/O 优先级</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityUnavailable">I/O 优先级不可用</sys:String>
|
||||
<sys:String x:Key="ProcessSummary_IoPriorityFormat">I/O 优先级:{0}</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityVeryLow">极低</sys:String>
|
||||
<sys:String x:Key="ProcessView_PriorityMedium">中</sys:String>
|
||||
<sys:String x:Key="ProcessView_RefreshInfo">刷新进程信息</sys:String>
|
||||
@@ -437,6 +442,11 @@
|
||||
<sys:String x:Key="SettingsView_DebugLogging">开启调试诊断日志记录</sys:String>
|
||||
<sys:String x:Key="SettingsView_PerformanceCounters">启用内部性能计数器</sys:String>
|
||||
|
||||
<sys:String x:Key="SettingsView_SomethingWrong">遇到问题?</sys:String>
|
||||
<sys:String x:Key="SettingsView_DiscordDescription">加入 ThreadPilot Discord 社区以获取帮助并参与讨论。</sys:String>
|
||||
<sys:String x:Key="SettingsView_OpenDiscord">打开 Discord</sys:String>
|
||||
<sys:String x:Key="SettingsView_IssuesDescription">通过 GitHub Issues 报告错误或异常行为。</sys:String>
|
||||
<sys:String x:Key="SettingsView_ReportIssue">报告问题</sys:String>
|
||||
<sys:String x:Key="SettingsView_About">关于应用</sys:String>
|
||||
<sys:String x:Key="SettingsView_Version">软件版本:</sys:String>
|
||||
<sys:String x:Key="SettingsView_Copyright">版权所有 © 2026 PrimeBuild</sys:String>
|
||||
@@ -547,6 +557,28 @@
|
||||
<sys:String x:Key="SystemTweak_HighSchedulingCategory_Desc">为游戏应用程序提供高调度优先级</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Name">菜单显示延迟</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MenuShowDelay_Desc">显示上下文菜单之前的延迟时间</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Name">游戏模式</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GameMode_Desc">Windows 游戏模式调度优化</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Name">内存完整性 (HVCI)</sys:String>
|
||||
<sys:String x:Key="SystemTweak_MemoryIntegrity_Desc">打开 Windows 安全中心。关闭此保护会降低系统安全性,并且可能需要重启。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Name">硬件加速 GPU 计划</sys:String>
|
||||
<sys:String x:Key="SystemTweak_Hags_Desc">打开 Windows 图形设置以查看 HAGS。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Name">窗口化游戏优化</sys:String>
|
||||
<sys:String x:Key="SystemTweak_WindowedOptimizations_Desc">打开 Windows 图形设置以管理 Flip Model 优化。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Name">USB 选择性暂停</sys:String>
|
||||
<sys:String x:Key="SystemTweak_UsbSelectiveSuspend_Desc">控制接通电源时当前电源计划的 USB 选择性暂停。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Name">提高指针精确度</sys:String>
|
||||
<sys:String x:Key="SystemTweak_PointerPrecision_Desc">控制 Windows 鼠标加速。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Name">禁用以太网节能</sys:String>
|
||||
<sys:String x:Key="SystemTweak_EthernetPowerSaving_Desc">禁用物理以太网适配器支持的 EEE、Green Ethernet 和节能属性。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Name">禁用中断调节</sys:String>
|
||||
<sys:String x:Key="SystemTweak_InterruptModeration_Desc">可以降低以太网延迟,但会增加 CPU 和中断负载。</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Name">GPU MSI 模式</sys:String>
|
||||
<sys:String x:Key="SystemTweak_GpuMsiMode_Desc">仅当显示驱动已公开 MSISupported 时控制 MSI。需要重启。</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_OpenSettings">打开设置</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusManagedByWindows">由 Windows 管理</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusOpenSettingsFailed">无法打开 Windows 设置</sys:String>
|
||||
<sys:String x:Key="SystemTweaks_StatusSettingsOpenedFormat">已打开 {0} 的设置</sys:String>
|
||||
|
||||
<!-- SystemTweaksViewModel Messages -->
|
||||
<sys:String x:Key="SystemTweaks_StatusReady">就绪</sys:String>
|
||||
|
||||
@@ -20,20 +20,26 @@ namespace ThreadPilot.Models
|
||||
|
||||
public CpuSelection? CpuSelection { get; init; }
|
||||
|
||||
public long? LegacyAffinityMask { get; init; }
|
||||
|
||||
public CpuAssignmentMode CpuAssignmentMode { get; init; } = CpuAssignmentMode.Automatic;
|
||||
public long? LegacyAffinityMask { get; init; }
|
||||
|
||||
public CpuAssignmentMode CpuAssignmentMode { get; init; } = CpuAssignmentMode.Automatic;
|
||||
|
||||
public ProcessPriorityClass? Priority { get; init; }
|
||||
|
||||
public ProcessMemoryPriority? MemoryPriority { get; init; }
|
||||
|
||||
public ProcessIoPriority? IoPriority { get; init; }
|
||||
|
||||
public bool ApplyAffinityOnStart { get; init; }
|
||||
|
||||
public bool ApplyPriorityOnStart { get; init; }
|
||||
|
||||
public bool ApplyMemoryPriorityOnStart { get; init; }
|
||||
|
||||
public bool ApplyIoPriorityOnStart { get; init; }
|
||||
|
||||
public bool PreventSystemSleepWhileRunning { get; init; }
|
||||
|
||||
public DateTime CreatedAt { get; init; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime UpdatedAt { get; init; } = DateTime.UtcNow;
|
||||
@@ -67,6 +73,10 @@ namespace ThreadPilot.Models
|
||||
|
||||
public bool MemoryPriorityApplied { get; init; }
|
||||
|
||||
public bool IoPriorityApplied { get; init; }
|
||||
|
||||
public bool PreventSleepApplied { get; init; }
|
||||
|
||||
public string? ErrorCode { get; init; }
|
||||
|
||||
public string UserMessage { get; init; } = string.Empty;
|
||||
|
||||
@@ -11,4 +11,12 @@ namespace ThreadPilot.Models
|
||||
BelowNormal = 4,
|
||||
Normal = 5,
|
||||
}
|
||||
|
||||
public enum ProcessIoPriority
|
||||
{
|
||||
VeryLow = 0,
|
||||
Low = 1,
|
||||
Normal = 2,
|
||||
High = 3,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,14 @@ namespace ThreadPilot.Platforms.Windows
|
||||
uint processInformationSize);
|
||||
|
||||
int GetLastWin32Error();
|
||||
|
||||
int QueryIoPriority(SafeProcessHandle process, ref int priority, out uint returnLength)
|
||||
{
|
||||
returnLength = 0;
|
||||
return unchecked((int)0xC0000002);
|
||||
}
|
||||
|
||||
int SetIoPriority(SafeProcessHandle process, ref int priority) => unchecked((int)0xC0000002);
|
||||
}
|
||||
|
||||
public sealed class ProcessMemoryPriorityNativeApi : IProcessMemoryPriorityNativeApi
|
||||
@@ -73,6 +81,21 @@ namespace ThreadPilot.Platforms.Windows
|
||||
{
|
||||
return Marshal.GetLastWin32Error();
|
||||
}
|
||||
|
||||
public int QueryIoPriority(SafeProcessHandle process, ref int priority, out uint returnLength) =>
|
||||
ProcessMemoryPriorityNativeMethods.NtQueryInformationProcess(
|
||||
process,
|
||||
ProcessMemoryPriorityNativeMethods.ProcessIoPriority,
|
||||
ref priority,
|
||||
sizeof(int),
|
||||
out returnLength);
|
||||
|
||||
public int SetIoPriority(SafeProcessHandle process, ref int priority) =>
|
||||
ProcessMemoryPriorityNativeMethods.NtSetInformationProcess(
|
||||
process,
|
||||
ProcessMemoryPriorityNativeMethods.ProcessIoPriority,
|
||||
ref priority,
|
||||
sizeof(int));
|
||||
}
|
||||
|
||||
public enum ProcessInformationClass
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace ThreadPilot.Platforms.Windows
|
||||
|
||||
internal static partial class ProcessMemoryPriorityNativeMethods
|
||||
{
|
||||
internal const int ProcessIoPriority = 33;
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
public static partial SafeProcessHandle OpenProcess(
|
||||
ProcessAccessFlags access,
|
||||
@@ -29,5 +31,20 @@ namespace ThreadPilot.Platforms.Windows
|
||||
ProcessInformationClass processInformationClass,
|
||||
ref MemoryPriorityInformation processInformation,
|
||||
uint processInformationSize);
|
||||
|
||||
[LibraryImport("ntdll.dll")]
|
||||
public static partial int NtQueryInformationProcess(
|
||||
SafeProcessHandle process,
|
||||
int processInformationClass,
|
||||
ref int processInformation,
|
||||
int processInformationLength,
|
||||
out uint returnLength);
|
||||
|
||||
[LibraryImport("ntdll.dll")]
|
||||
public static partial int NtSetInformationProcess(
|
||||
SafeProcessHandle process,
|
||||
int processInformationClass,
|
||||
ref int processInformation,
|
||||
int processInformationLength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,8 @@ Useful startup arguments:
|
||||
|
||||
In `Power Plans > Custom Power Plans`, use `Add .pow File` to import custom power plans directly from the app.
|
||||
|
||||
ThreadPilot does not bundle third-party `.pow` files. The Power Plans page can open the community Discord catalog on request; Settings also links to Discord support and GitHub Issues. Existing plans already imported into Windows are not removed by updates.
|
||||
|
||||
## 🧱 Build from Source
|
||||
|
||||
```powershell
|
||||
@@ -161,6 +163,9 @@ Build release artifacts with the project script:
|
||||
|
||||
- CI validates build, formatting, analyzers, vulnerability checks, and secret scanning.
|
||||
- Security disclosures are handled through private GitHub advisories. See [`docs/SECURITY.md`](docs/SECURITY.md).
|
||||
- ThreadPilot has no analytics or telemetry. See [`docs/PRIVACY.md`](docs/PRIVACY.md).
|
||||
- Release signing scope and controls are documented in [`docs/CODE_SIGNING_POLICY.md`](docs/CODE_SIGNING_POLICY.md).
|
||||
- Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org), once the pending application is approved; current artifacts are unsigned.
|
||||
- Change history is tracked in [`docs/CHANGELOG.md`](docs/CHANGELOG.md).
|
||||
- Coverage focuses on business/application code and excludes generated build artifacts.
|
||||
|
||||
@@ -170,6 +175,8 @@ Build release artifacts with the project script:
|
||||
- [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md)
|
||||
- [`docs/CODE_OF_CONDUCT.md`](docs/CODE_OF_CONDUCT.md)
|
||||
- [`docs/RELEASE_SIGNING.md`](docs/RELEASE_SIGNING.md)
|
||||
- [`docs/CODE_SIGNING_POLICY.md`](docs/CODE_SIGNING_POLICY.md)
|
||||
- [`docs/PRIVACY.md`](docs/PRIVACY.md)
|
||||
- [`docs/release/PACKAGING.md`](docs/release/PACKAGING.md)
|
||||
- [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md)
|
||||
- [`docs/QUALITY_GATES.md`](docs/QUALITY_GATES.md)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ThreadPilot.Services
|
||||
|
||||
try
|
||||
{
|
||||
using var key = Registry.CurrentUser.OpenSubKey(GameBarKeyPath, writable: true);
|
||||
using var key = Registry.CurrentUser.CreateSubKey(GameBarKeyPath, writable: true);
|
||||
if (key == null)
|
||||
{
|
||||
this.logger.LogWarning("GameBar registry key not found, cannot modify Game Mode");
|
||||
@@ -75,38 +75,6 @@ namespace ThreadPilot.Services
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DisableGameModeForAffinityAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isEnabled = await this.IsGameModeEnabledAsync();
|
||||
if (!isEnabled)
|
||||
{
|
||||
this.logger.LogDebug("Game Mode already disabled, no action needed");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.logger.LogInformation("Game Mode is enabled, disabling for better CPU affinity control");
|
||||
bool success = await this.SetGameModeAsync(false);
|
||||
|
||||
if (success)
|
||||
{
|
||||
this.logger.LogInformation("Successfully disabled Windows Game Mode for CPU affinity optimization");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.logger.LogWarning("Failed to disable Game Mode, CPU affinity may be affected");
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogError(ex, "Error disabling Game Mode for affinity");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ namespace ThreadPilot.Services
|
||||
Task<bool> IsGameModeEnabledAsync();
|
||||
|
||||
Task<bool> SetGameModeAsync(bool enabled);
|
||||
|
||||
Task<bool> DisableGameModeForAffinityAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,14 @@ namespace ThreadPilot.Services
|
||||
Task<ProcessMemoryPriority?> GetMemoryPriorityAsync(ProcessModel process);
|
||||
|
||||
Task<ProcessOperationResult> SetMemoryPriorityAsync(ProcessModel process, ProcessMemoryPriority priority);
|
||||
|
||||
Task<ProcessIoPriority?> GetIoPriorityAsync(ProcessModel process) =>
|
||||
Task.FromResult<ProcessIoPriority?>(null);
|
||||
|
||||
Task<ProcessOperationResult> SetIoPriorityAsync(ProcessModel process, ProcessIoPriority priority) =>
|
||||
Task.FromResult(ProcessOperationResult.Failed(
|
||||
"Unsupported",
|
||||
"I/O priority is unavailable on this system.",
|
||||
"The configured priority service does not support I/O priority."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@ namespace ThreadPilot.Services
|
||||
|
||||
Task<bool> IsProcessStillRunning(ProcessModel process);
|
||||
|
||||
Task<bool> SetIdleServerStateAsync(ProcessModel process, bool enableIdleServer);
|
||||
|
||||
Task<bool> SetRegistryPriorityAsync(ProcessModel process, bool enable, ProcessPriorityClass priority);
|
||||
|
||||
void SetUseCpuSets(bool useCpuSets);
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace ThreadPilot.Services
|
||||
{
|
||||
event EventHandler<TweakStatusChangedEventArgs>? TweakStatusChanged;
|
||||
|
||||
Task<TweakStatus> GetGameModeStatusAsync();
|
||||
|
||||
Task<bool> SetGameModeAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetCoreParkingStatusAsync();
|
||||
|
||||
Task<bool> SetCoreParkingAsync(bool enabled);
|
||||
@@ -34,6 +38,30 @@ namespace ThreadPilot.Services
|
||||
Task<TweakStatus> GetMenuShowDelayStatusAsync();
|
||||
|
||||
Task<bool> SetMenuShowDelayAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetUsbSelectiveSuspendStatusAsync();
|
||||
|
||||
Task<bool> SetUsbSelectiveSuspendAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetPointerPrecisionStatusAsync();
|
||||
|
||||
Task<bool> SetPointerPrecisionAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetEthernetPowerSavingStatusAsync();
|
||||
|
||||
Task<bool> SetEthernetPowerSavingAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetInterruptModerationStatusAsync();
|
||||
|
||||
Task<bool> SetInterruptModerationAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetGpuMsiModeStatusAsync();
|
||||
|
||||
Task<bool> SetGpuMsiModeAsync(bool enabled);
|
||||
|
||||
Task<TweakStatus> GetMemoryIntegrityStatusAsync();
|
||||
|
||||
Task<bool> OpenSettingsAsync(SystemTweak tweak);
|
||||
}
|
||||
|
||||
public class TweakStatus
|
||||
@@ -43,6 +71,8 @@ namespace ThreadPilot.Services
|
||||
public bool IsAvailable { get; set; }
|
||||
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
public string? StatusText { get; set; }
|
||||
}
|
||||
|
||||
public class TweakStatusChangedEventArgs : EventArgs
|
||||
@@ -63,8 +93,17 @@ namespace ThreadPilot.Services
|
||||
|
||||
public enum SystemTweak
|
||||
{
|
||||
GameMode,
|
||||
CoreParking,
|
||||
CStates,
|
||||
MemoryIntegrity,
|
||||
Hags,
|
||||
WindowedOptimizations,
|
||||
UsbSelectiveSuspend,
|
||||
PointerPrecision,
|
||||
EthernetPowerSaving,
|
||||
InterruptModeration,
|
||||
GpuMsiMode,
|
||||
SysMain,
|
||||
Prefetch,
|
||||
PowerThrottling,
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace ThreadPilot.Services
|
||||
private readonly IAffinityApplyService affinityApplyService;
|
||||
private readonly IProcessService processService;
|
||||
private readonly IProcessMemoryPriorityService memoryPriorityService;
|
||||
private readonly ProcessPowerRequestService? powerRequestService;
|
||||
private readonly ILogger<PersistentRulesEngine> logger;
|
||||
|
||||
public PersistentRulesEngine(
|
||||
@@ -40,7 +41,8 @@ namespace ThreadPilot.Services
|
||||
IAffinityApplyService affinityApplyService,
|
||||
IProcessService processService,
|
||||
IProcessMemoryPriorityService memoryPriorityService,
|
||||
ILogger<PersistentRulesEngine> logger)
|
||||
ILogger<PersistentRulesEngine> logger,
|
||||
ProcessPowerRequestService? powerRequestService = null)
|
||||
{
|
||||
this.ruleStore = ruleStore ?? throw new ArgumentNullException(nameof(ruleStore));
|
||||
this.matcher = matcher ?? throw new ArgumentNullException(nameof(matcher));
|
||||
@@ -48,6 +50,7 @@ namespace ThreadPilot.Services
|
||||
this.processService = processService ?? throw new ArgumentNullException(nameof(processService));
|
||||
this.memoryPriorityService = memoryPriorityService ?? throw new ArgumentNullException(nameof(memoryPriorityService));
|
||||
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
this.powerRequestService = powerRequestService;
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<PersistentRuleApplyResult>> ApplyMatchingRulesAsync(
|
||||
@@ -79,7 +82,11 @@ namespace ThreadPilot.Services
|
||||
var result = CreateSuccessResult(rule, process);
|
||||
var success = true;
|
||||
|
||||
if (!rule.ApplyAffinityOnStart && !rule.ApplyPriorityOnStart && !rule.ApplyMemoryPriorityOnStart)
|
||||
if (!rule.ApplyAffinityOnStart &&
|
||||
!rule.ApplyPriorityOnStart &&
|
||||
!rule.ApplyMemoryPriorityOnStart &&
|
||||
!rule.ApplyIoPriorityOnStart &&
|
||||
!rule.PreventSystemSleepWhileRunning)
|
||||
{
|
||||
return MarkRuleConfigurationFailure(
|
||||
result,
|
||||
@@ -172,6 +179,50 @@ namespace ThreadPilot.Services
|
||||
}
|
||||
}
|
||||
|
||||
if (rule.ApplyIoPriorityOnStart && !result.IsProcessExited)
|
||||
{
|
||||
if (!rule.IoPriority.HasValue)
|
||||
{
|
||||
success = false;
|
||||
result = MarkRuleConfigurationFailure(
|
||||
result,
|
||||
rule,
|
||||
"PersistentRuleMissingIoPriority",
|
||||
"This saved rule has no I/O priority value to apply.");
|
||||
}
|
||||
else
|
||||
{
|
||||
var ioResult = await this.memoryPriorityService
|
||||
.SetIoPriorityAsync(process, rule.IoPriority.Value)
|
||||
.ConfigureAwait(false);
|
||||
if (ioResult.Success)
|
||||
{
|
||||
result = result with { IoPriorityApplied = true };
|
||||
}
|
||||
else
|
||||
{
|
||||
success = false;
|
||||
result = this.MergeMemoryPriorityFailure(result, ioResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rule.PreventSystemSleepWhileRunning && !result.IsProcessExited)
|
||||
{
|
||||
var applied = this.powerRequestService != null &&
|
||||
await this.powerRequestService.SetPreventSleepAsync(process, enabled: true).ConfigureAwait(false);
|
||||
result = result with { PreventSleepApplied = applied };
|
||||
success = success && applied;
|
||||
if (!applied)
|
||||
{
|
||||
result = result with
|
||||
{
|
||||
ErrorCode = "PowerRequestFailed",
|
||||
UserMessage = "ThreadPilot could not prevent system sleep for this process.",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return result with
|
||||
{
|
||||
Success = success,
|
||||
@@ -291,18 +342,18 @@ namespace ThreadPilot.Services
|
||||
|
||||
private Task<AffinityApplyResult> ApplyAffinityAsync(PersistentProcessRule rule, ProcessModel process)
|
||||
{
|
||||
if (rule.CpuSelection != null)
|
||||
{
|
||||
return rule.CpuAssignmentMode == CpuAssignmentMode.Automatic
|
||||
? this.affinityApplyService.ApplyAsync(process, rule.CpuSelection)
|
||||
: this.affinityApplyService.ApplyAsync(process, rule.CpuSelection, rule.CpuAssignmentMode);
|
||||
}
|
||||
if (rule.CpuSelection != null)
|
||||
{
|
||||
return rule.CpuAssignmentMode == CpuAssignmentMode.Automatic
|
||||
? this.affinityApplyService.ApplyAsync(process, rule.CpuSelection)
|
||||
: this.affinityApplyService.ApplyAsync(process, rule.CpuSelection, rule.CpuAssignmentMode);
|
||||
}
|
||||
|
||||
if (rule.LegacyAffinityMask.HasValue)
|
||||
{
|
||||
return rule.CpuAssignmentMode == CpuAssignmentMode.Automatic
|
||||
? this.affinityApplyService.ApplyAsync(process, rule.LegacyAffinityMask.Value)
|
||||
: this.affinityApplyService.ApplyAsync(process, rule.LegacyAffinityMask.Value, rule.CpuAssignmentMode);
|
||||
return rule.CpuAssignmentMode == CpuAssignmentMode.Automatic
|
||||
? this.affinityApplyService.ApplyAsync(process, rule.LegacyAffinityMask.Value)
|
||||
: this.affinityApplyService.ApplyAsync(process, rule.LegacyAffinityMask.Value, rule.CpuAssignmentMode);
|
||||
}
|
||||
|
||||
return Task.FromResult(AffinityApplyResult.Succeeded(0, process.ProcessorAffinity));
|
||||
|
||||
@@ -183,6 +183,119 @@ namespace ThreadPilot.Services
|
||||
}
|
||||
}
|
||||
|
||||
public Task<ProcessIoPriority?> GetIoPriorityAsync(ProcessModel process)
|
||||
{
|
||||
if (!this.nativeApi.IsSupported || !IsValidProcess(process))
|
||||
{
|
||||
return Task.FromResult<ProcessIoPriority?>(null);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var handle = this.nativeApi.OpenProcess(
|
||||
ProcessAccessFlags.PROCESS_QUERY_LIMITED_INFORMATION,
|
||||
inheritHandle: false,
|
||||
(uint)process.ProcessId);
|
||||
if (handle.IsInvalid)
|
||||
{
|
||||
return Task.FromResult<ProcessIoPriority?>(null);
|
||||
}
|
||||
|
||||
var value = 0;
|
||||
var status = this.nativeApi.QueryIoPriority(handle, ref value, out _);
|
||||
return Task.FromResult(status == 0 && Enum.IsDefined(typeof(ProcessIoPriority), value)
|
||||
? (ProcessIoPriority?)value
|
||||
: null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogDebug(ex, "Could not read I/O priority for process {ProcessId}", process.ProcessId);
|
||||
return Task.FromResult<ProcessIoPriority?>(null);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<ProcessOperationResult> SetIoPriorityAsync(ProcessModel process, ProcessIoPriority priority)
|
||||
{
|
||||
if (!IsValidProcess(process))
|
||||
{
|
||||
return Task.FromResult(ProcessOperationResult.Failed(
|
||||
InvalidProcessErrorCode,
|
||||
ProcessOperationUserMessages.ProcessExited,
|
||||
"Process is null or has an invalid PID."));
|
||||
}
|
||||
|
||||
if (!Enum.IsDefined(priority))
|
||||
{
|
||||
return Task.FromResult(ProcessOperationResult.Failed(
|
||||
"InvalidIoPriority",
|
||||
"This I/O priority value is not supported.",
|
||||
$"I/O priority value '{priority}' is not supported."));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var handle = this.nativeApi.OpenProcess(
|
||||
ProcessAccessFlags.PROCESS_SET_INFORMATION,
|
||||
inheritHandle: false,
|
||||
(uint)process.ProcessId);
|
||||
if (handle.IsInvalid)
|
||||
{
|
||||
return Task.FromResult(this.FromLastError("OpenProcess failed before setting I/O priority."));
|
||||
}
|
||||
|
||||
var value = (int)priority;
|
||||
var status = this.nativeApi.SetIoPriority(handle, ref value);
|
||||
if (status == 0)
|
||||
{
|
||||
return Task.FromResult(ProcessOperationResult.Succeeded(
|
||||
"I/O priority applied.",
|
||||
$"Process {process.Name} (PID: {process.ProcessId}) I/O priority set to {priority}."));
|
||||
}
|
||||
|
||||
return Task.FromResult(status switch
|
||||
{
|
||||
unchecked((int)0xC0000022) => ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.AccessDenied,
|
||||
ProcessOperationUserMessages.AccessDenied,
|
||||
$"NtSetInformationProcess failed with NTSTATUS 0x{status:X8}.",
|
||||
isAccessDenied: true),
|
||||
unchecked((int)0xC0000008) => ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.ProcessExited,
|
||||
ProcessOperationUserMessages.ProcessExited,
|
||||
$"NtSetInformationProcess failed with NTSTATUS 0x{status:X8}.",
|
||||
isProcessExited: true),
|
||||
_ => ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.NativeApplyFailed,
|
||||
"ThreadPilot could not apply the I/O priority change.",
|
||||
$"NtSetInformationProcess failed with NTSTATUS 0x{status:X8}."),
|
||||
});
|
||||
}
|
||||
catch (Exception ex) when (AffinityApplyExceptionClassifier.IsProcessExited(ex))
|
||||
{
|
||||
return Task.FromResult(ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.ProcessExited,
|
||||
ProcessOperationUserMessages.ProcessExited,
|
||||
ex.Message,
|
||||
isProcessExited: true));
|
||||
}
|
||||
catch (Exception ex) when (AffinityApplyExceptionClassifier.IsAccessDenied(ex))
|
||||
{
|
||||
return Task.FromResult(ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.AccessDenied,
|
||||
ProcessOperationUserMessages.AccessDenied,
|
||||
ex.Message,
|
||||
isAccessDenied: true));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogWarning(ex, "I/O priority apply failed for process {ProcessId}", process.ProcessId);
|
||||
return Task.FromResult(ProcessOperationResult.Failed(
|
||||
AffinityApplyErrorCodes.NativeApplyFailed,
|
||||
"ThreadPilot could not apply the I/O priority change.",
|
||||
ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsValidProcess(ProcessModel? process) =>
|
||||
process != null && process.ProcessId > 0;
|
||||
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
namespace ThreadPilot.Services
|
||||
{
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using ThreadPilot.Models;
|
||||
|
||||
public sealed partial class ProcessPowerRequestService : IDisposable
|
||||
{
|
||||
private readonly Dictionary<int, RequestEntry> requests = [];
|
||||
private readonly object sync = new();
|
||||
private readonly ILogger<ProcessPowerRequestService> logger;
|
||||
private bool disposed;
|
||||
|
||||
public ProcessPowerRequestService(ILogger<ProcessPowerRequestService> logger)
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public Task<bool> SetPreventSleepAsync(ProcessModel process, bool enabled)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(process);
|
||||
if (!enabled)
|
||||
{
|
||||
this.Release(process.ProcessId);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
lock (this.sync)
|
||||
{
|
||||
ObjectDisposedException.ThrowIf(this.disposed, this);
|
||||
if (this.requests.ContainsKey(process.ProcessId))
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var target = Process.GetProcessById(process.ProcessId);
|
||||
var reasonPointer = Marshal.StringToHGlobalUni($"ThreadPilot: {process.Name} is running");
|
||||
SafeFileHandle request;
|
||||
try
|
||||
{
|
||||
var context = new ReasonContext { Version = 0, Flags = 1, SimpleReasonString = reasonPointer };
|
||||
request = NativeMethods.PowerCreateRequest(ref context);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(reasonPointer);
|
||||
}
|
||||
|
||||
if (request.IsInvalid || !NativeMethods.PowerSetRequest(request, PowerRequestType.SystemRequired))
|
||||
{
|
||||
request.Dispose();
|
||||
target.Dispose();
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
EventHandler exited = (_, _) => this.Release(process.ProcessId);
|
||||
target.EnableRaisingEvents = true;
|
||||
target.Exited += exited;
|
||||
lock (this.sync)
|
||||
{
|
||||
if (this.disposed || this.requests.ContainsKey(process.ProcessId))
|
||||
{
|
||||
target.Exited -= exited;
|
||||
_ = NativeMethods.PowerClearRequest(request, PowerRequestType.SystemRequired);
|
||||
request.Dispose();
|
||||
target.Dispose();
|
||||
return Task.FromResult(!this.disposed);
|
||||
}
|
||||
|
||||
this.requests[process.ProcessId] = new RequestEntry(target, request, exited);
|
||||
}
|
||||
|
||||
if (target.HasExited)
|
||||
{
|
||||
this.Release(process.ProcessId);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogDebug(ex, "Could not create power request for PID {ProcessId}", process.ProcessId);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void Release(int processId)
|
||||
{
|
||||
RequestEntry? entry;
|
||||
lock (this.sync)
|
||||
{
|
||||
if (!this.requests.Remove(processId, out entry))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
entry.Process.Exited -= entry.ExitedHandler;
|
||||
_ = NativeMethods.PowerClearRequest(entry.Request, PowerRequestType.SystemRequired);
|
||||
entry.Request.Dispose();
|
||||
entry.Process.Dispose();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
int[] processIds;
|
||||
lock (this.sync)
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.disposed = true;
|
||||
processIds = [.. this.requests.Keys];
|
||||
}
|
||||
|
||||
foreach (var processId in processIds)
|
||||
{
|
||||
this.Release(processId);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed record RequestEntry(Process Process, SafeFileHandle Request, EventHandler ExitedHandler);
|
||||
|
||||
private enum PowerRequestType
|
||||
{
|
||||
DisplayRequired = 0,
|
||||
SystemRequired = 1,
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct ReasonContext
|
||||
{
|
||||
public uint Version;
|
||||
public uint Flags;
|
||||
public IntPtr SimpleReasonString;
|
||||
}
|
||||
|
||||
private static partial class NativeMethods
|
||||
{
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
internal static partial SafeFileHandle PowerCreateRequest(ref ReasonContext context);
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static partial bool PowerSetRequest(SafeFileHandle request, PowerRequestType requestType);
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static partial bool PowerClearRequest(SafeFileHandle request, PowerRequestType requestType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,14 @@ namespace ThreadPilot.Services
|
||||
ProcessRuleCreationPayload payload,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<ProcessRuleCreationResult> SaveCurrentSettingsAsRuleAsync(
|
||||
ProcessModel process,
|
||||
IReadOnlyList<bool>? currentCoreSelection,
|
||||
ProcessMemoryPriority? currentMemoryPriority,
|
||||
CpuAssignmentMode cpuAssignmentMode = CpuAssignmentMode.Automatic,
|
||||
CancellationToken cancellationToken = default);
|
||||
Task<ProcessRuleCreationResult> SaveCurrentSettingsAsRuleAsync(
|
||||
ProcessModel process,
|
||||
IReadOnlyList<bool>? currentCoreSelection,
|
||||
ProcessMemoryPriority? currentMemoryPriority,
|
||||
CpuAssignmentMode cpuAssignmentMode = CpuAssignmentMode.Automatic,
|
||||
ProcessIoPriority? currentIoPriority = null,
|
||||
bool preventSystemSleepWhileRunning = false,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public sealed record ProcessRuleCreationPayload
|
||||
@@ -30,9 +32,13 @@ namespace ThreadPilot.Services
|
||||
|
||||
public ProcessPriorityClass? Priority { get; init; }
|
||||
|
||||
public ProcessMemoryPriority? MemoryPriority { get; init; }
|
||||
|
||||
public CpuAssignmentMode CpuAssignmentMode { get; init; } = CpuAssignmentMode.Automatic;
|
||||
public ProcessMemoryPriority? MemoryPriority { get; init; }
|
||||
|
||||
public ProcessIoPriority? IoPriority { get; init; }
|
||||
|
||||
public bool PreventSystemSleepWhileRunning { get; init; }
|
||||
|
||||
public CpuAssignmentMode CpuAssignmentMode { get; init; } = CpuAssignmentMode.Automatic;
|
||||
}
|
||||
|
||||
public sealed record ProcessRuleCreationResult
|
||||
@@ -85,12 +91,14 @@ namespace ThreadPilot.Services
|
||||
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
|
||||
public async Task<ProcessRuleCreationResult> SaveCurrentSettingsAsRuleAsync(
|
||||
ProcessModel process,
|
||||
IReadOnlyList<bool>? currentCoreSelection,
|
||||
ProcessMemoryPriority? currentMemoryPriority,
|
||||
CpuAssignmentMode cpuAssignmentMode = CpuAssignmentMode.Automatic,
|
||||
CancellationToken cancellationToken = default)
|
||||
public async Task<ProcessRuleCreationResult> SaveCurrentSettingsAsRuleAsync(
|
||||
ProcessModel process,
|
||||
IReadOnlyList<bool>? currentCoreSelection,
|
||||
ProcessMemoryPriority? currentMemoryPriority,
|
||||
CpuAssignmentMode cpuAssignmentMode = CpuAssignmentMode.Automatic,
|
||||
ProcessIoPriority? currentIoPriority = null,
|
||||
bool preventSystemSleepWhileRunning = false,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(process);
|
||||
|
||||
@@ -99,8 +107,10 @@ namespace ThreadPilot.Services
|
||||
Priority = ShouldCaptureCurrentCpuPriority(process.Priority)
|
||||
? process.Priority
|
||||
: null,
|
||||
MemoryPriority = currentMemoryPriority,
|
||||
CpuAssignmentMode = cpuAssignmentMode,
|
||||
MemoryPriority = currentMemoryPriority,
|
||||
IoPriority = currentIoPriority,
|
||||
PreventSystemSleepWhileRunning = preventSystemSleepWhileRunning,
|
||||
CpuAssignmentMode = cpuAssignmentMode,
|
||||
};
|
||||
|
||||
var affinityPayload = currentCoreSelection == null
|
||||
@@ -123,8 +133,8 @@ namespace ThreadPilot.Services
|
||||
payload = payload with
|
||||
{
|
||||
CpuSelection = affinityPayload.Payload.CpuSelection,
|
||||
LegacyAffinityMask = affinityPayload.Payload.LegacyAffinityMask,
|
||||
CpuAssignmentMode = cpuAssignmentMode,
|
||||
LegacyAffinityMask = affinityPayload.Payload.LegacyAffinityMask,
|
||||
CpuAssignmentMode = cpuAssignmentMode,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -170,13 +180,16 @@ namespace ThreadPilot.Services
|
||||
ProcessName = processName,
|
||||
ExecutablePath = executablePath,
|
||||
CpuSelection = payload.CpuSelection,
|
||||
LegacyAffinityMask = HasSelectionPayload(payload.CpuSelection) ? null : payload.LegacyAffinityMask,
|
||||
CpuAssignmentMode = payload.CpuAssignmentMode,
|
||||
LegacyAffinityMask = HasSelectionPayload(payload.CpuSelection) ? null : payload.LegacyAffinityMask,
|
||||
CpuAssignmentMode = payload.CpuAssignmentMode,
|
||||
Priority = payload.Priority,
|
||||
MemoryPriority = payload.MemoryPriority,
|
||||
IoPriority = payload.IoPriority,
|
||||
ApplyAffinityOnStart = HasSelectionPayload(payload.CpuSelection) || payload.LegacyAffinityMask.HasValue,
|
||||
ApplyPriorityOnStart = payload.Priority.HasValue,
|
||||
ApplyMemoryPriorityOnStart = payload.MemoryPriority.HasValue,
|
||||
ApplyIoPriorityOnStart = payload.IoPriority.HasValue,
|
||||
PreventSystemSleepWhileRunning = payload.PreventSystemSleepWhileRunning,
|
||||
CreatedAt = existing?.CreatedAt ?? now,
|
||||
UpdatedAt = now,
|
||||
Description = RuleDescription,
|
||||
@@ -241,21 +254,21 @@ namespace ThreadPilot.Services
|
||||
ProcessOperationUserMessages.RealtimePriorityBlocked);
|
||||
}
|
||||
|
||||
var hasCpuSelection = HasSelectionPayload(payload.CpuSelection);
|
||||
var hasCpuSelection = HasSelectionPayload(payload.CpuSelection);
|
||||
var legacyMask = hasCpuSelection ? null : payload.LegacyAffinityMask;
|
||||
if (legacyMask.HasValue && legacyMask.Value == 0)
|
||||
{
|
||||
legacyMask = null;
|
||||
}
|
||||
|
||||
return PayloadSanitizationResult.Succeeded(payload with
|
||||
{
|
||||
CpuSelection = hasCpuSelection ? payload.CpuSelection : null,
|
||||
LegacyAffinityMask = legacyMask,
|
||||
CpuAssignmentMode = Enum.IsDefined(payload.CpuAssignmentMode)
|
||||
? payload.CpuAssignmentMode
|
||||
: CpuAssignmentMode.Automatic,
|
||||
});
|
||||
return PayloadSanitizationResult.Succeeded(payload with
|
||||
{
|
||||
CpuSelection = hasCpuSelection ? payload.CpuSelection : null,
|
||||
LegacyAffinityMask = legacyMask,
|
||||
CpuAssignmentMode = Enum.IsDefined(payload.CpuAssignmentMode)
|
||||
? payload.CpuAssignmentMode
|
||||
: CpuAssignmentMode.Automatic,
|
||||
});
|
||||
}
|
||||
|
||||
private static bool ShouldCaptureCurrentCpuPriority(ProcessPriorityClass priority) =>
|
||||
@@ -268,7 +281,9 @@ namespace ThreadPilot.Services
|
||||
HasSelectionPayload(payload.CpuSelection) ||
|
||||
payload.LegacyAffinityMask.HasValue ||
|
||||
payload.Priority.HasValue ||
|
||||
payload.MemoryPriority.HasValue;
|
||||
payload.MemoryPriority.HasValue ||
|
||||
payload.IoPriority.HasValue ||
|
||||
payload.PreventSystemSleepWhileRunning;
|
||||
|
||||
private static bool HasSelectionPayload(CpuSelection? selection) =>
|
||||
selection != null &&
|
||||
|
||||
@@ -1106,43 +1106,6 @@ namespace ThreadPilot.Services
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<bool> SetIdleServerStateAsync(ProcessModel process, bool enableIdleServer)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get the actual process
|
||||
var actualProcess = Process.GetProcessById(process.ProcessId);
|
||||
|
||||
// Use Windows API to set execution state for the process
|
||||
// This prevents the system from entering idle state while the process is running
|
||||
if (!enableIdleServer)
|
||||
{
|
||||
// Disable idle server by setting ES_CONTINUOUS | ES_SYSTEM_REQUIRED
|
||||
// This keeps the system awake while the process is running
|
||||
var result = NativeMethods.SetThreadExecutionState(
|
||||
NativeMethods.EXECUTION_STATE.ES_CONTINUOUS |
|
||||
NativeMethods.EXECUTION_STATE.ES_SYSTEM_REQUIRED);
|
||||
|
||||
return result != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Re-enable idle server by clearing the execution state
|
||||
var result = NativeMethods.SetThreadExecutionState(
|
||||
NativeMethods.EXECUTION_STATE.ES_CONTINUOUS);
|
||||
|
||||
return result != 0;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<bool> SetRegistryPriorityAsync(ProcessModel process, bool enable, ProcessPriorityClass priority)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(process);
|
||||
@@ -1443,19 +1406,4 @@ namespace ThreadPilot.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static class NativeMethods
|
||||
{
|
||||
[System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
|
||||
public static extern uint SetThreadExecutionState(EXECUTION_STATE esFlags);
|
||||
|
||||
[System.Flags]
|
||||
public enum EXECUTION_STATE : uint
|
||||
{
|
||||
ES_AWAYMODE_REQUIRED = 0x00000040,
|
||||
ES_CONTINUOUS = 0x80000000,
|
||||
ES_DISPLAY_REQUIRED = 0x00000002,
|
||||
ES_SYSTEM_REQUIRED = 0x00000001,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace ThreadPilot.Services
|
||||
services.AddSingleton<IProcessAffinityApplyCoordinator, ProcessAffinityApplyCoordinator>();
|
||||
services.AddSingleton<IProcessMemoryPriorityNativeApi>(ProcessMemoryPriorityNativeApi.Instance);
|
||||
services.AddSingleton<IProcessMemoryPriorityService, ProcessMemoryPriorityService>();
|
||||
services.AddSingleton<ProcessPowerRequestService>();
|
||||
services.AddSingleton<IPersistentProcessRuleStore, PersistentProcessRuleJsonStore>();
|
||||
services.AddSingleton<IPersistentProcessRuleMatcher, PersistentProcessRuleMatcher>();
|
||||
services.AddSingleton<IPersistentRulesEngine, PersistentRulesEngine>();
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace ThreadPilot.Services
|
||||
|
||||
public static string PersistentRulesFilePath => Path.Combine(AppDataRoot, "persistent_rules.json");
|
||||
|
||||
public static string DeviceTweakBackupsFilePath => Path.Combine(AppDataRoot, "device_tweak_backups.json");
|
||||
|
||||
public static string PowerPlansDirectory => Path.Combine(AppDataRoot, "Powerplans");
|
||||
|
||||
public static void EnsureAppDataDirectories()
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
namespace ThreadPilot.Services
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ServiceProcess;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -19,21 +24,247 @@ namespace ThreadPilot.Services
|
||||
private static readonly Guid ProcessorSettingsSubgroupGuid = new("54533251-82be-4824-96c1-47b60b740d00");
|
||||
private static readonly Guid CoreParkingSettingGuid = new("0cc5b647-c1df-4637-891a-dec35c318583");
|
||||
private static readonly Guid ProcessorIdleDisableSettingGuid = new("5d76a2ca-e8c0-402f-a133-2158492d58ad");
|
||||
private static readonly Guid UsbSettingsSubgroupGuid = new("2a737441-1930-4402-8d77-b2bebba308a3");
|
||||
private static readonly Guid UsbSelectiveSuspendSettingGuid = new("48e6b7a6-50f5-4782-a5d4-53bb8f07e226");
|
||||
private static readonly string[] EthernetPowerSavingValueNames = ["*EEE", "AdvancedEEE", "EnableGreenEthernet", "PowerSavingMode"];
|
||||
private static readonly string[] InterruptModerationValueNames = ["*InterruptModeration"];
|
||||
private const string NetworkAdapterClassPath = @"SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}";
|
||||
private const string MsiPropertiesSuffix = @"Device Parameters\Interrupt Management\MessageSignaledInterruptProperties";
|
||||
private const string GamesSchedulingKeyPath = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games";
|
||||
private const string SchedulingCategoryValueName = "Scheduling Category";
|
||||
internal const string HighSchedulingCategoryEnabledValue = "High";
|
||||
private const string HighSchedulingCategoryDisabledValue = "Medium";
|
||||
private readonly ILogger<SystemTweaksService> logger;
|
||||
private readonly IElevationService elevationService;
|
||||
private readonly IGameModeService gameModeService;
|
||||
|
||||
public event EventHandler<TweakStatusChangedEventArgs>? TweakStatusChanged;
|
||||
|
||||
public SystemTweaksService(
|
||||
ILogger<SystemTweaksService> logger,
|
||||
IElevationService elevationService)
|
||||
IElevationService elevationService,
|
||||
IGameModeService gameModeService)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.elevationService = elevationService;
|
||||
this.gameModeService = gameModeService;
|
||||
}
|
||||
|
||||
public async Task<TweakStatus> GetGameModeStatusAsync() => new()
|
||||
{
|
||||
IsEnabled = await this.gameModeService.IsGameModeEnabledAsync(),
|
||||
IsAvailable = true,
|
||||
};
|
||||
|
||||
public async Task<bool> SetGameModeAsync(bool enabled)
|
||||
{
|
||||
var success = await this.gameModeService.SetGameModeAsync(enabled);
|
||||
if (success)
|
||||
{
|
||||
this.RaiseStatusChanged(nameof(SystemTweak.GameMode), await this.GetGameModeStatusAsync());
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public Task<TweakStatus> GetUsbSelectiveSuspendStatusAsync()
|
||||
{
|
||||
var available = TryReadAcPowerSetting(
|
||||
UsbSettingsSubgroupGuid,
|
||||
UsbSelectiveSuspendSettingGuid,
|
||||
out var value,
|
||||
out var error);
|
||||
return Task.FromResult(new TweakStatus
|
||||
{
|
||||
IsEnabled = value != 0,
|
||||
IsAvailable = available,
|
||||
ErrorMessage = error,
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<bool> SetUsbSelectiveSuspendAsync(bool enabled)
|
||||
{
|
||||
string? error = "Administrator privileges are required.";
|
||||
if (!this.elevationService.IsRunningAsAdministrator() ||
|
||||
!TryWriteAcPowerSetting(
|
||||
UsbSettingsSubgroupGuid,
|
||||
UsbSelectiveSuspendSettingGuid,
|
||||
enabled ? 1u : 0u,
|
||||
out error))
|
||||
{
|
||||
this.logger.LogWarning("Could not update USB selective suspend: {Error}", error);
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = await this.GetUsbSelectiveSuspendStatusAsync();
|
||||
this.RaiseStatusChanged(nameof(SystemTweak.UsbSelectiveSuspend), status);
|
||||
return status.IsAvailable && status.IsEnabled == enabled;
|
||||
}
|
||||
|
||||
public Task<TweakStatus> GetPointerPrecisionStatusAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Mouse");
|
||||
var mouseSpeed = key?.GetValue("MouseSpeed")?.ToString();
|
||||
if (int.TryParse(mouseSpeed, NumberStyles.Integer, CultureInfo.InvariantCulture, out var speed))
|
||||
{
|
||||
return Task.FromResult(new TweakStatus { IsEnabled = speed != 0, IsAvailable = true });
|
||||
}
|
||||
|
||||
var values = new int[3];
|
||||
var available = NativeMethods.SystemParametersInfo(NativeMethods.SpiGetMouse, 0, values, 0);
|
||||
return Task.FromResult(new TweakStatus
|
||||
{
|
||||
IsEnabled = available && values[2] != 0,
|
||||
IsAvailable = available,
|
||||
ErrorMessage = available ? null : new Win32Exception(Marshal.GetLastWin32Error()).Message,
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message });
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> SetPointerPrecisionAsync(bool enabled)
|
||||
{
|
||||
var values = new int[3];
|
||||
if (!NativeMethods.SystemParametersInfo(NativeMethods.SpiGetMouse, 0, values, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
values = GetPointerPrecisionValues(enabled, values);
|
||||
var notified = NativeMethods.SystemParametersInfo(
|
||||
NativeMethods.SpiSetMouse,
|
||||
0,
|
||||
values,
|
||||
NativeMethods.SpifUpdateIniFile | NativeMethods.SpifSendChange);
|
||||
if (!notified)
|
||||
{
|
||||
this.logger.LogWarning(
|
||||
"Windows did not apply pointer precision immediately: {Error}",
|
||||
new Win32Exception(Marshal.GetLastWin32Error()).Message);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var key = Registry.CurrentUser.CreateSubKey(@"Control Panel\Mouse", writable: true);
|
||||
key.SetValue("MouseThreshold1", values[0].ToString(CultureInfo.InvariantCulture), RegistryValueKind.String);
|
||||
key.SetValue("MouseThreshold2", values[1].ToString(CultureInfo.InvariantCulture), RegistryValueKind.String);
|
||||
key.SetValue("MouseSpeed", values[2].ToString(CultureInfo.InvariantCulture), RegistryValueKind.String);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogWarning(ex, "Could not persist pointer precision settings.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = await this.GetPointerPrecisionStatusAsync();
|
||||
this.RaiseStatusChanged(nameof(SystemTweak.PointerPrecision), status);
|
||||
return status.IsAvailable && status.IsEnabled == enabled;
|
||||
}
|
||||
|
||||
internal static int[] GetPointerPrecisionValues(bool enabled, IReadOnlyList<int> current)
|
||||
{
|
||||
if (current.Count < 3)
|
||||
{
|
||||
throw new ArgumentException("Three mouse parameters are required.", nameof(current));
|
||||
}
|
||||
|
||||
if (!enabled)
|
||||
{
|
||||
// Windows may normalize acceleration back to enabled when non-zero
|
||||
// thresholds are submitted with acceleration disabled.
|
||||
return [0, 0, 0];
|
||||
}
|
||||
|
||||
return
|
||||
[
|
||||
current[0] > 0 ? current[0] : 6,
|
||||
current[1] > 0 ? current[1] : 10,
|
||||
current[2] > 0 ? current[2] : 1,
|
||||
];
|
||||
}
|
||||
|
||||
public Task<TweakStatus> GetEthernetPowerSavingStatusAsync() =>
|
||||
Task.FromResult(GetRegistryTargetsStatus(FindEthernetTargets(EthernetPowerSavingValueNames), enabledValue: 0));
|
||||
|
||||
public Task<bool> SetEthernetPowerSavingAsync(bool enabled) =>
|
||||
this.SetRegistryTargetsAsync(
|
||||
SystemTweak.EthernetPowerSaving,
|
||||
FindEthernetTargets(EthernetPowerSavingValueNames),
|
||||
enabled,
|
||||
enabledValue: 0,
|
||||
disabledValue: 1);
|
||||
|
||||
public Task<TweakStatus> GetInterruptModerationStatusAsync() =>
|
||||
Task.FromResult(GetRegistryTargetsStatus(FindEthernetTargets(InterruptModerationValueNames), enabledValue: 0));
|
||||
|
||||
public Task<bool> SetInterruptModerationAsync(bool enabled) =>
|
||||
this.SetRegistryTargetsAsync(
|
||||
SystemTweak.InterruptModeration,
|
||||
FindEthernetTargets(InterruptModerationValueNames),
|
||||
enabled,
|
||||
enabledValue: 0,
|
||||
disabledValue: 1);
|
||||
|
||||
public Task<TweakStatus> GetGpuMsiModeStatusAsync() =>
|
||||
Task.FromResult(GetRegistryTargetsStatus(FindGpuMsiTargets(), enabledValue: 1));
|
||||
|
||||
public Task<bool> SetGpuMsiModeAsync(bool enabled) =>
|
||||
this.SetRegistryTargetsAsync(
|
||||
SystemTweak.GpuMsiMode,
|
||||
FindGpuMsiTargets(),
|
||||
enabled,
|
||||
enabledValue: 1,
|
||||
disabledValue: 0,
|
||||
restoreOriginalWhenDisabled: false);
|
||||
|
||||
public Task<TweakStatus> GetMemoryIntegrityStatusAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\CI\State");
|
||||
var value = key == null ? null : ReadRegistryIntValue(key, "HVCIEnabled");
|
||||
return Task.FromResult(new TweakStatus
|
||||
{
|
||||
IsEnabled = value == 1,
|
||||
IsAvailable = value.HasValue,
|
||||
ErrorMessage = value.HasValue ? null : "Memory Integrity state is not exposed by Windows.",
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Task.FromResult(new TweakStatus { IsAvailable = false, ErrorMessage = ex.Message });
|
||||
}
|
||||
}
|
||||
|
||||
public Task<bool> OpenSettingsAsync(SystemTweak tweak)
|
||||
{
|
||||
var uri = tweak switch
|
||||
{
|
||||
SystemTweak.MemoryIntegrity => "windowsdefender://coreisolation",
|
||||
SystemTweak.Hags or SystemTweak.WindowedOptimizations => "ms-settings:display-advancedgraphics-default",
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (uri == null)
|
||||
{
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(uri) { UseShellExecute = true });
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogWarning(ex, "Could not open Windows settings for {Tweak}", tweak);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<TweakStatus> GetCoreParkingStatusAsync()
|
||||
@@ -420,7 +651,233 @@ namespace ThreadPilot.Services
|
||||
internal static string GetHighSchedulingCategoryRegistryValue(bool enabled) =>
|
||||
enabled ? HighSchedulingCategoryEnabledValue : HighSchedulingCategoryDisabledValue;
|
||||
|
||||
private void RaiseStatusChanged(string tweakName, TweakStatus status) =>
|
||||
this.TweakStatusChanged?.Invoke(this, new TweakStatusChangedEventArgs(tweakName, status));
|
||||
|
||||
private static List<RegistryTarget> FindEthernetTargets(IEnumerable<string> valueNames)
|
||||
{
|
||||
var targets = new List<RegistryTarget>();
|
||||
using var adapters = Registry.LocalMachine.OpenSubKey(NetworkAdapterClassPath);
|
||||
if (adapters == null)
|
||||
{
|
||||
return targets;
|
||||
}
|
||||
|
||||
foreach (var subKeyName in adapters.GetSubKeyNames())
|
||||
{
|
||||
var path = $@"{NetworkAdapterClassPath}\{subKeyName}";
|
||||
using var adapter = Registry.LocalMachine.OpenSubKey(path);
|
||||
var characteristics = adapter == null ? null : ReadRegistryIntValue(adapter, "Characteristics");
|
||||
if (adapter == null ||
|
||||
ReadRegistryIntValue(adapter, "*IfType") != 6 ||
|
||||
!characteristics.HasValue ||
|
||||
(characteristics.Value & 0x4) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var valueName in valueNames)
|
||||
{
|
||||
AddRegistryTarget(targets, adapter, path, valueName);
|
||||
}
|
||||
}
|
||||
|
||||
return targets;
|
||||
}
|
||||
|
||||
private static List<RegistryTarget> FindGpuMsiTargets()
|
||||
{
|
||||
var targets = new List<RegistryTarget>();
|
||||
try
|
||||
{
|
||||
using var searcher = new ManagementObjectSearcher("SELECT PNPDeviceID FROM Win32_VideoController");
|
||||
using var results = searcher.Get();
|
||||
foreach (ManagementObject device in results)
|
||||
{
|
||||
using (device)
|
||||
{
|
||||
var pnpDeviceId = device["PNPDeviceID"]?.ToString();
|
||||
if (string.IsNullOrWhiteSpace(pnpDeviceId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var path = $@"SYSTEM\CurrentControlSet\Enum\{pnpDeviceId}\{MsiPropertiesSuffix}";
|
||||
using var key = Registry.LocalMachine.OpenSubKey(path);
|
||||
if (key != null)
|
||||
{
|
||||
AddRegistryTarget(targets, key, path, "MSISupported");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ManagementException)
|
||||
{
|
||||
// No supported display adapter information is available.
|
||||
}
|
||||
|
||||
return targets;
|
||||
}
|
||||
|
||||
private static void AddRegistryTarget(
|
||||
ICollection<RegistryTarget> targets,
|
||||
RegistryKey key,
|
||||
string path,
|
||||
string valueName)
|
||||
{
|
||||
var value = ReadRegistryIntValue(key, valueName);
|
||||
if (!value.HasValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var kind = key.GetValueKind(valueName);
|
||||
if (kind is RegistryValueKind.DWord or RegistryValueKind.QWord or RegistryValueKind.String)
|
||||
{
|
||||
targets.Add(new RegistryTarget(path, valueName, value.Value, kind));
|
||||
}
|
||||
}
|
||||
|
||||
private static TweakStatus GetRegistryTargetsStatus(IReadOnlyCollection<RegistryTarget> targets, int enabledValue) => new()
|
||||
{
|
||||
IsAvailable = targets.Count > 0,
|
||||
IsEnabled = targets.Count > 0 && targets.All(target => target.Value == enabledValue),
|
||||
ErrorMessage = targets.Count == 0 ? "No supported driver property was found." : null,
|
||||
};
|
||||
|
||||
private async Task<bool> SetRegistryTargetsAsync(
|
||||
SystemTweak tweak,
|
||||
IReadOnlyCollection<RegistryTarget> targets,
|
||||
bool enabled,
|
||||
int enabledValue,
|
||||
int disabledValue,
|
||||
bool restoreOriginalWhenDisabled = true)
|
||||
{
|
||||
if (!this.elevationService.IsRunningAsAdministrator() || targets.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var backups = this.LoadRegistryBackups();
|
||||
var changedBackups = false;
|
||||
var changedTargets = new List<RegistryTarget>();
|
||||
try
|
||||
{
|
||||
foreach (var target in targets)
|
||||
{
|
||||
var backupKey = target.BackupKey;
|
||||
if (!backups.ContainsKey(backupKey))
|
||||
{
|
||||
backups[backupKey] = new RegistryValueBackup(target.Value, target.Kind);
|
||||
changedBackups = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (changedBackups)
|
||||
{
|
||||
this.SaveRegistryBackups(backups);
|
||||
}
|
||||
|
||||
foreach (var target in targets)
|
||||
{
|
||||
var backupKey = target.BackupKey;
|
||||
var desiredValue = enabled
|
||||
? enabledValue
|
||||
: restoreOriginalWhenDisabled && backups.TryGetValue(backupKey, out var backup)
|
||||
? backup.Value
|
||||
: disabledValue;
|
||||
using var key = Registry.LocalMachine.OpenSubKey(target.Path, writable: true);
|
||||
if (key == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
key.SetValue(
|
||||
target.ValueName,
|
||||
target.Kind == RegistryValueKind.String
|
||||
? desiredValue.ToString(CultureInfo.InvariantCulture)
|
||||
: desiredValue,
|
||||
target.Kind);
|
||||
changedTargets.Add(target);
|
||||
}
|
||||
|
||||
var status = tweak switch
|
||||
{
|
||||
SystemTweak.EthernetPowerSaving => await this.GetEthernetPowerSavingStatusAsync(),
|
||||
SystemTweak.InterruptModeration => await this.GetInterruptModerationStatusAsync(),
|
||||
SystemTweak.GpuMsiMode => await this.GetGpuMsiModeStatusAsync(),
|
||||
_ => new TweakStatus { IsAvailable = false },
|
||||
};
|
||||
this.RaiseStatusChanged(tweak.ToString(), status);
|
||||
return status.IsAvailable && status.IsEnabled == enabled;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogWarning(ex, "Could not update driver tweak {Tweak}", tweak);
|
||||
foreach (var target in changedTargets)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.OpenSubKey(target.Path, writable: true);
|
||||
key?.SetValue(
|
||||
target.ValueName,
|
||||
target.Kind == RegistryValueKind.String
|
||||
? target.Value.ToString(CultureInfo.InvariantCulture)
|
||||
: target.Value,
|
||||
target.Kind);
|
||||
}
|
||||
catch (Exception rollbackException)
|
||||
{
|
||||
this.logger.LogWarning(
|
||||
rollbackException,
|
||||
"Could not roll back {Path}\\{ValueName}",
|
||||
target.Path,
|
||||
target.ValueName);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string, RegistryValueBackup> LoadRegistryBackups()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(StoragePaths.DeviceTweakBackupsFilePath))
|
||||
{
|
||||
return new Dictionary<string, RegistryValueBackup>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
var stored = JsonSerializer.Deserialize<Dictionary<string, RegistryValueBackup>>(
|
||||
File.ReadAllText(StoragePaths.DeviceTweakBackupsFilePath));
|
||||
return stored == null
|
||||
? new Dictionary<string, RegistryValueBackup>(StringComparer.OrdinalIgnoreCase)
|
||||
: new Dictionary<string, RegistryValueBackup>(stored, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.logger.LogWarning(ex, "Could not load device tweak backups");
|
||||
return new Dictionary<string, RegistryValueBackup>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveRegistryBackups(Dictionary<string, RegistryValueBackup> backups)
|
||||
{
|
||||
StoragePaths.EnsureAppDataDirectories();
|
||||
File.WriteAllText(
|
||||
StoragePaths.DeviceTweakBackupsFilePath,
|
||||
JsonSerializer.Serialize(backups, new JsonSerializerOptions { WriteIndented = true }));
|
||||
}
|
||||
|
||||
private static bool TryReadAcPowerSetting(Guid settingGuid, out uint value, out string? error)
|
||||
=> TryReadAcPowerSetting(ProcessorSettingsSubgroupGuid, settingGuid, out value, out error);
|
||||
|
||||
private static bool TryReadAcPowerSetting(
|
||||
Guid subgroupGuid,
|
||||
Guid settingGuid,
|
||||
out uint value,
|
||||
out string? error)
|
||||
{
|
||||
value = 0;
|
||||
if (!TryGetActivePowerScheme(out var schemeGuid, out error))
|
||||
@@ -428,7 +885,6 @@ namespace ThreadPilot.Services
|
||||
return false;
|
||||
}
|
||||
|
||||
var subgroupGuid = ProcessorSettingsSubgroupGuid;
|
||||
var result = NativeMethods.PowerReadAcValueIndex(
|
||||
IntPtr.Zero,
|
||||
ref schemeGuid,
|
||||
@@ -446,13 +902,19 @@ namespace ThreadPilot.Services
|
||||
}
|
||||
|
||||
private static bool TryWriteAcPowerSetting(Guid settingGuid, uint value, out string? error)
|
||||
=> TryWriteAcPowerSetting(ProcessorSettingsSubgroupGuid, settingGuid, value, out error);
|
||||
|
||||
private static bool TryWriteAcPowerSetting(
|
||||
Guid subgroupGuid,
|
||||
Guid settingGuid,
|
||||
uint value,
|
||||
out string? error)
|
||||
{
|
||||
if (!TryGetActivePowerScheme(out var schemeGuid, out error))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var subgroupGuid = ProcessorSettingsSubgroupGuid;
|
||||
var writeResult = NativeMethods.PowerWriteAcValueIndex(
|
||||
IntPtr.Zero,
|
||||
ref schemeGuid,
|
||||
@@ -585,6 +1047,17 @@ namespace ThreadPilot.Services
|
||||
public string StandardError { get; }
|
||||
}
|
||||
|
||||
private sealed record RegistryTarget(
|
||||
string Path,
|
||||
string ValueName,
|
||||
int Value,
|
||||
RegistryValueKind Kind)
|
||||
{
|
||||
public string BackupKey => $"{this.Path}|{this.ValueName}";
|
||||
}
|
||||
|
||||
private sealed record RegistryValueBackup(int Value, RegistryValueKind Kind);
|
||||
|
||||
public Task<TweakStatus> GetMenuShowDelayStatusAsync()
|
||||
{
|
||||
try
|
||||
@@ -645,6 +1118,15 @@ namespace ThreadPilot.Services
|
||||
|
||||
private static class NativeMethods
|
||||
{
|
||||
internal const uint SpiGetMouse = 0x0003;
|
||||
internal const uint SpiSetMouse = 0x0004;
|
||||
internal const uint SpifUpdateIniFile = 0x0001;
|
||||
internal const uint SpifSendChange = 0x0002;
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool SystemParametersInfo(uint action, uint parameter, [In, Out] int[] values, uint flags);
|
||||
|
||||
[DllImport("PowrProf.dll", EntryPoint = "PowerGetActiveScheme")]
|
||||
internal static extern uint PowerGetActiveScheme(IntPtr userRootPowerKey, out IntPtr activePolicyGuid);
|
||||
|
||||
|
||||
@@ -1,127 +1,41 @@
|
||||
namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Moq;
|
||||
using ThreadPilot.Services;
|
||||
using ThreadPilot.Services.Abstractions;
|
||||
|
||||
public sealed class BundledPowerPlanAssetTests
|
||||
{
|
||||
private static readonly string[] NewPlanFiles =
|
||||
[
|
||||
"0 Synez_Public_Power.pow",
|
||||
"arsenza low latency (INTEL FIX THREAD-DIRECTOR).pow",
|
||||
"arsenza low latency.pow",
|
||||
"AutoOS.pow",
|
||||
"BEYOND-PERFORMANCE-AMD+INTEL.pow",
|
||||
"Bitsum Highest Performance.pow",
|
||||
"cactusOS.pow",
|
||||
"FPSHEAVEN2026.pow",
|
||||
"GALA's ultimate performance(AMD).pow",
|
||||
"Gavot Performance.pow",
|
||||
"GTweaks Power Plan V3.pow",
|
||||
"imribiy2026.pow",
|
||||
"IrisFixed.pow",
|
||||
"J o k r O S P o w e r P l a n.pow",
|
||||
"Jackpot2026.pow",
|
||||
"Kizzimo's Extreme Low Latency.pow",
|
||||
"KSOS11.pow",
|
||||
"melody LowestLatency.pow",
|
||||
"Microsoft High performance.pow",
|
||||
"Microsoft Ultimate Performance.pow",
|
||||
"Mitstas IDLE ENABLED.pow",
|
||||
"n1kobg GPU_Booster_Power_Plan.pow",
|
||||
"Prodazin Power Plan.pow",
|
||||
"Reticle v2.pow",
|
||||
"RevisionPowerPlanV2.8.pow",
|
||||
"RIP Tweaks Power Plan.pow",
|
||||
"Rosca Tweaks v2.pow",
|
||||
"Velo's Power Plan.pow",
|
||||
"VTRL Optimized.pow",
|
||||
"XNRL Pro Plan.pow",
|
||||
];
|
||||
|
||||
[Fact]
|
||||
public void BundledPlans_AreValidUniqueRegistryHives()
|
||||
{
|
||||
var directory = GetPowerPlansDirectory();
|
||||
var files = Directory.GetFiles(directory, "*", SearchOption.TopDirectoryOnly);
|
||||
|
||||
Assert.All(files, file => Assert.Equal(".pow", Path.GetExtension(file), ignoreCase: true));
|
||||
Assert.Equal(files.Length, files.Select(Path.GetFileNameWithoutExtension).Distinct(StringComparer.OrdinalIgnoreCase).Count());
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
var info = new FileInfo(file);
|
||||
Assert.InRange(info.Length, 4, 10 * 1024 * 1024);
|
||||
Assert.Equal("regf", Encoding.ASCII.GetString(File.ReadAllBytes(file), 0, 4));
|
||||
Assert.DoesNotContain(Path.GetFileName(file), character => Path.GetInvalidFileNameChars().Contains(character));
|
||||
Assert.DoesNotContain("#U", Path.GetFileName(file), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task NewAndExistingPlans_ArePresentDiscoverableAndNotBinaryDuplicates()
|
||||
{
|
||||
var directory = GetPowerPlansDirectory();
|
||||
var files = Directory.GetFiles(directory, "*.pow", SearchOption.TopDirectoryOnly);
|
||||
var newPaths = NewPlanFiles.Select(file => Path.Combine(directory, file)).ToArray();
|
||||
|
||||
Assert.All(newPaths, path => Assert.True(File.Exists(path), $"Missing bundled power plan: {Path.GetFileName(path)}"));
|
||||
Assert.All(["Amit.pow", "Beyond.pow", "L1 Final Version.pow"], file => Assert.True(File.Exists(Path.Combine(directory, file))));
|
||||
|
||||
var newHashes = newPaths.ToDictionary(path => path, GetSha256);
|
||||
Assert.Equal(newHashes.Count, newHashes.Values.Distinct(StringComparer.Ordinal).Count());
|
||||
Assert.All(
|
||||
newHashes,
|
||||
entry => Assert.DoesNotContain(files, file => !newPaths.Contains(file, StringComparer.OrdinalIgnoreCase) && GetSha256(file) == entry.Value));
|
||||
|
||||
var logger = new Mock<IEnhancedLoggingService>(MockBehavior.Loose);
|
||||
var runner = new Mock<IProcessRunner>(MockBehavior.Strict);
|
||||
var service = new PowerPlanService(
|
||||
NullLogger<PowerPlanService>.Instance,
|
||||
logger.Object,
|
||||
runner.Object,
|
||||
() => directory);
|
||||
|
||||
var discovered = await service.GetCustomPowerPlansAsync();
|
||||
Assert.All(NewPlanFiles, file => Assert.Contains(discovered, plan => plan.Name == Path.GetFileNameWithoutExtension(file)));
|
||||
Assert.Equal(files.Length, discovered.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Project_ConfiguresAllPowerPlansForBuildAndPublish()
|
||||
{
|
||||
var project = File.ReadAllText(Path.Combine(FindRepositoryRoot(), "ThreadPilot.csproj"));
|
||||
|
||||
Assert.Contains(@"assets\Powerplans\**\*.pow", project, StringComparison.Ordinal);
|
||||
Assert.Contains(@"<TargetPath>Powerplans\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>", project, StringComparison.Ordinal);
|
||||
Assert.Contains("<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>", project, StringComparison.Ordinal);
|
||||
Assert.Contains("<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>", project, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static string GetPowerPlansDirectory() =>
|
||||
Path.Combine(FindRepositoryRoot(), "assets", "Powerplans");
|
||||
|
||||
private static string GetSha256(string path) =>
|
||||
Convert.ToHexString(SHA256.HashData(File.ReadAllBytes(path)));
|
||||
|
||||
private static string FindRepositoryRoot()
|
||||
{
|
||||
var directory = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (directory != null)
|
||||
{
|
||||
if (File.Exists(Path.Combine(directory.FullName, "ThreadPilot.csproj")))
|
||||
{
|
||||
return directory.FullName;
|
||||
}
|
||||
|
||||
directory = directory.Parent;
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("Repository root could not be located.");
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
public sealed class BundledPowerPlanAssetTests
|
||||
{
|
||||
[Fact]
|
||||
public void RepositoryAndReleasePipeline_DoNotBundlePowerPlanFiles()
|
||||
{
|
||||
var root = FindRepositoryRoot();
|
||||
var assetsDirectory = Path.Combine(root, "assets", "Powerplans");
|
||||
var project = File.ReadAllText(Path.Combine(root, "ThreadPilot.csproj"));
|
||||
var installer = File.ReadAllText(Path.Combine(root, "Installer", "setup.iss"));
|
||||
var workflow = File.ReadAllText(Path.Combine(root, ".github", "workflows", "release.yml"));
|
||||
|
||||
Assert.Empty(Directory.Exists(assetsDirectory)
|
||||
? Directory.GetFiles(assetsDirectory, "*.pow", SearchOption.AllDirectories)
|
||||
: []);
|
||||
Assert.DoesNotContain(@"assets\Powerplans", project, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.DoesNotContain(@"\Powerplans\*", installer, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.DoesNotContain("assets/Powerplans", workflow, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CommunityAndSupportLinks_AreTheRequestedDestinations()
|
||||
{
|
||||
Assert.Equal("https://discord.gg/EmPfb57Kfr", ThreadPilot.ViewModels.PowerPlanViewModel.MorePlansUrl);
|
||||
Assert.Equal("https://discord.gg/VYwkCbr4vH", ThreadPilot.ViewModels.SettingsViewModel.DiscordUrl);
|
||||
Assert.Equal("https://github.com/PrimeBuild-pc/ThreadPilot/issues", ThreadPilot.ViewModels.SettingsViewModel.IssuesUrl);
|
||||
}
|
||||
|
||||
private static string FindRepositoryRoot()
|
||||
{
|
||||
var directory = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (directory != null && !File.Exists(Path.Combine(directory.FullName, "ThreadPilot.csproj")))
|
||||
{
|
||||
directory = directory.Parent;
|
||||
}
|
||||
|
||||
return directory?.FullName ?? throw new InvalidOperationException("Repository root was not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace ThreadPilot.Core.Tests
|
||||
|
||||
public sealed partial class PackagingMetadataTests
|
||||
{
|
||||
private const string ReleaseVersion = "1.6.0";
|
||||
private const string ReleaseAssemblyVersion = "1.6.0.0";
|
||||
private const string ReleaseVersion = "1.7.0";
|
||||
private const string ReleaseAssemblyVersion = "1.7.0.0";
|
||||
|
||||
[Fact]
|
||||
public void InnoInstallers_UseStableDisplayNameAndSeparateVersionMetadata()
|
||||
@@ -38,10 +38,31 @@ namespace ThreadPilot.Core.Tests
|
||||
Assert.Contains("[UninstallDelete]", script, StringComparison.Ordinal);
|
||||
Assert.Contains("Name: \"{userappdata}\\ThreadPilot\"", script, StringComparison.Ordinal);
|
||||
Assert.Contains("ThreadPilot user data is preserved during install/update", script, StringComparison.Ordinal);
|
||||
Assert.Contains("ThreadPilot_Launch", script, StringComparison.Ordinal);
|
||||
Assert.Contains("ThreadPilot_Startup", script, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("[InstallDelete]", script, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("Name: \"{userappdata}\"", script, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PortableUninstallers_RemoveCurrentAndLegacyStartupTasks()
|
||||
{
|
||||
var root = FindRepositoryRoot();
|
||||
var paths = new[]
|
||||
{
|
||||
Path.Combine(root, "build", "build-release.ps1"),
|
||||
Path.Combine(root, "build", "package-release-zips.ps1"),
|
||||
Path.Combine(root, ".github", "workflows", "release.yml"),
|
||||
};
|
||||
|
||||
foreach (var path in paths)
|
||||
{
|
||||
var script = File.ReadAllText(path);
|
||||
Assert.Contains("ThreadPilot_Launch", script, StringComparison.Ordinal);
|
||||
Assert.Contains("ThreadPilot_Startup", script, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PrimaryInstaller_CleansOnlyRecognizedLegacyBetaUninstallRegistryEntries()
|
||||
{
|
||||
@@ -99,7 +120,7 @@ namespace ThreadPilot.Core.Tests
|
||||
throw new InvalidOperationException("Repository root could not be located.");
|
||||
}
|
||||
|
||||
[GeneratedRegex("#define MyAppVersion \"1\\.6\\.0\"", RegexOptions.CultureInvariant)]
|
||||
[GeneratedRegex("#define MyAppVersion \"1\\.7\\.0\"", RegexOptions.CultureInvariant)]
|
||||
private static partial Regex MyAppVersionRegex();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,13 +36,16 @@ namespace ThreadPilot.Core.Tests
|
||||
LogicalProcessors = [new ProcessorRef(0, 0, 0)],
|
||||
GlobalLogicalProcessorIndexes = [0],
|
||||
},
|
||||
LegacyAffinityMask = 3,
|
||||
CpuAssignmentMode = CpuAssignmentMode.IdealProcessor,
|
||||
LegacyAffinityMask = 3,
|
||||
CpuAssignmentMode = CpuAssignmentMode.IdealProcessor,
|
||||
Priority = ProcessPriorityClass.AboveNormal,
|
||||
MemoryPriority = ProcessMemoryPriority.BelowNormal,
|
||||
IoPriority = ProcessIoPriority.Low,
|
||||
ApplyAffinityOnStart = true,
|
||||
ApplyPriorityOnStart = true,
|
||||
ApplyMemoryPriorityOnStart = true,
|
||||
ApplyIoPriorityOnStart = true,
|
||||
PreventSystemSleepWhileRunning = true,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
UpdatedAt = DateTime.UtcNow,
|
||||
Description = ProcessOperationUserMessages.PersistentRulesDescription,
|
||||
@@ -56,11 +59,14 @@ namespace ThreadPilot.Core.Tests
|
||||
|
||||
var loadedRule = Assert.Single(loaded);
|
||||
Assert.Equal("rule-a", loadedRule.Id);
|
||||
Assert.Equal(3, loadedRule.LegacyAffinityMask);
|
||||
Assert.Equal(CpuAssignmentMode.IdealProcessor, loadedRule.CpuAssignmentMode);
|
||||
Assert.Equal(3, loadedRule.LegacyAffinityMask);
|
||||
Assert.Equal(CpuAssignmentMode.IdealProcessor, loadedRule.CpuAssignmentMode);
|
||||
Assert.Equal(ProcessPriorityClass.AboveNormal, loadedRule.Priority);
|
||||
Assert.Equal(ProcessMemoryPriority.BelowNormal, loadedRule.MemoryPriority);
|
||||
Assert.True(loadedRule.ApplyMemoryPriorityOnStart);
|
||||
Assert.Equal(ProcessIoPriority.Low, loadedRule.IoPriority);
|
||||
Assert.True(loadedRule.ApplyIoPriorityOnStart);
|
||||
Assert.True(loadedRule.PreventSystemSleepWhileRunning);
|
||||
Assert.NotNull(loadedRule.CpuSelection);
|
||||
Assert.Equal(0, loadedRule.CpuSelection.GlobalLogicalProcessorIndexes.Single());
|
||||
}
|
||||
@@ -68,30 +74,30 @@ namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
DeleteFile(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LoadAsync_OldRuleWithoutCpuAssignmentMode_DefaultsToAutomatic()
|
||||
{
|
||||
var filePath = CreateTemporaryFilePath();
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
|
||||
await File.WriteAllTextAsync(
|
||||
filePath,
|
||||
"""
|
||||
[{"Id":"legacy","Name":"Legacy","IsEnabled":true,"ProcessName":"game.exe","LegacyAffinityMask":3,"ApplyAffinityOnStart":true}]
|
||||
""");
|
||||
|
||||
try
|
||||
{
|
||||
var rule = Assert.Single(await new PersistentProcessRuleJsonStore(() => filePath).LoadAsync());
|
||||
Assert.Equal(CpuAssignmentMode.Automatic, rule.CpuAssignmentMode);
|
||||
Assert.Equal(3, rule.LegacyAffinityMask);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteFile(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LoadAsync_OldRuleWithoutCpuAssignmentMode_DefaultsToAutomatic()
|
||||
{
|
||||
var filePath = CreateTemporaryFilePath();
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
|
||||
await File.WriteAllTextAsync(
|
||||
filePath,
|
||||
"""
|
||||
[{"Id":"legacy","Name":"Legacy","IsEnabled":true,"ProcessName":"game.exe","LegacyAffinityMask":3,"ApplyAffinityOnStart":true}]
|
||||
""");
|
||||
|
||||
try
|
||||
{
|
||||
var rule = Assert.Single(await new PersistentProcessRuleJsonStore(() => filePath).LoadAsync());
|
||||
Assert.Equal(CpuAssignmentMode.Automatic, rule.CpuAssignmentMode);
|
||||
Assert.Equal(3, rule.LegacyAffinityMask);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DeleteFile(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MultipleRules_SaveThenReload_DoesNotLoseEntries()
|
||||
|
||||
@@ -56,5 +56,15 @@ namespace ThreadPilot.Core.Tests
|
||||
Assert.Contains("StatusPillBackgroundBrush", serialized, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("BorderThickness=\"4,1,1,1\"", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Header_ExposesLocalizedCommunityPlansLink()
|
||||
{
|
||||
var document = XDocument.Load(PowerPlanViewPath, LoadOptions.PreserveWhitespace);
|
||||
var serialized = document.ToString(SaveOptions.DisableFormatting);
|
||||
|
||||
Assert.Contains("OpenMorePlansCommand", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("PowerPlanView_MorePlans", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,24 @@ namespace ThreadPilot.Core.Tests
|
||||
Assert.Equal(ProcessAccessFlags.PROCESS_QUERY_LIMITED_INFORMATION, nativeApi.LastOpenAccess);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IoPriority_WithValidProcess_RoundTripsThroughNativeApi()
|
||||
{
|
||||
var nativeApi = new FakeProcessMemoryPriorityNativeApi
|
||||
{
|
||||
IoPriorityToReturn = ProcessIoPriority.Low,
|
||||
};
|
||||
var service = CreateService(nativeApi);
|
||||
var process = CreateProcess();
|
||||
|
||||
var observed = await service.GetIoPriorityAsync(process);
|
||||
var result = await service.SetIoPriorityAsync(process, ProcessIoPriority.High);
|
||||
|
||||
Assert.Equal(ProcessIoPriority.Low, observed);
|
||||
Assert.True(result.Success);
|
||||
Assert.Equal(ProcessIoPriority.High, nativeApi.LastSetIoPriority);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1, ProcessMemoryPriority.VeryLow)]
|
||||
[InlineData(2, ProcessMemoryPriority.Low)]
|
||||
@@ -198,6 +216,10 @@ namespace ThreadPilot.Core.Tests
|
||||
|
||||
public ProcessMemoryPriority PriorityToReturn { get; init; } = ProcessMemoryPriority.Normal;
|
||||
|
||||
public ProcessIoPriority IoPriorityToReturn { get; init; } = ProcessIoPriority.Normal;
|
||||
|
||||
public ProcessIoPriority? LastSetIoPriority { get; private set; }
|
||||
|
||||
public Exception? OpenException { get; init; }
|
||||
|
||||
public Exception? SetException { get; init; }
|
||||
@@ -243,6 +265,19 @@ namespace ThreadPilot.Core.Tests
|
||||
}
|
||||
|
||||
public int GetLastWin32Error() => this.LastError;
|
||||
|
||||
public int QueryIoPriority(SafeProcessHandle process, ref int priority, out uint returnLength)
|
||||
{
|
||||
priority = (int)this.IoPriorityToReturn;
|
||||
returnLength = sizeof(int);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int SetIoPriority(SafeProcessHandle process, ref int priority)
|
||||
{
|
||||
this.LastSetIoPriority = (ProcessIoPriority)priority;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,6 @@ namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
var processService = new Mock<IProcessService>(MockBehavior.Loose);
|
||||
var gameModeService = new Mock<IGameModeService>(MockBehavior.Loose);
|
||||
gameModeService
|
||||
.Setup(service => service.DisableGameModeForAffinityAsync())
|
||||
.ReturnsAsync(false);
|
||||
var viewModel = CreateViewModel(processService.Object, gameModeService.Object);
|
||||
|
||||
viewModel.SelectedProcess = new ProcessModel
|
||||
@@ -58,7 +55,7 @@ namespace ThreadPilot.Core.Tests
|
||||
Assert.True(viewModel.HasPendingAffinityEdits);
|
||||
Assert.Equal("Current OS affinity: 0x3", viewModel.CurrentAffinityText);
|
||||
Assert.Equal("Pending core mask: 0x1", viewModel.PendingAffinityText);
|
||||
Assert.Equal("CPU selection staged. Use Apply CPU Assignment to apply it.", viewModel.AffinityEditStateText);
|
||||
Assert.Equal("CPU selection staged. Use Apply CPU Assignment to apply it.", viewModel.AffinityEditStateText);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace ThreadPilot.Core.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsView_ExposesPersistentRuleAutoApplyToggle()
|
||||
public void SettingsView_ExposesPersistentRuleAutoApplyToggle()
|
||||
{
|
||||
var settingsViewPath = Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
@@ -214,28 +214,28 @@ namespace ThreadPilot.Core.Tests
|
||||
Assert.Contains("Text=\"{DynamicResource SettingsView_ApplyOnStart}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("TextWrapping=\"Wrap\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("IsChecked=\"{Binding Settings.ApplyPersistentRulesOnProcessStart}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("Text=\"{DynamicResource SettingsView_ApplyOnStartDescription}\"", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsView_ExposesDefaultCpuAssignmentAndReadOnlyReservedState()
|
||||
{
|
||||
var settingsViewPath = Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"Views",
|
||||
"SettingsView.xaml");
|
||||
var serialized = File.ReadAllText(settingsViewPath);
|
||||
|
||||
Assert.Contains("SelectedValue=\"{Binding Settings.DefaultCpuAssignmentMode}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("Text=\"{Binding ReservedCpuSetsStatus}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("AutomationProperties.HelpText=\"{DynamicResource SettingsView_ReservedCpuSetsTooltip}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("ReservedCpuSetsStatus, Mode=TwoWay", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
Assert.Contains("Text=\"{DynamicResource SettingsView_ApplyOnStartDescription}\"", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsView_ExposesDefaultCpuAssignmentAndReadOnlyReservedState()
|
||||
{
|
||||
var settingsViewPath = Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"Views",
|
||||
"SettingsView.xaml");
|
||||
var serialized = File.ReadAllText(settingsViewPath);
|
||||
|
||||
Assert.Contains("SelectedValue=\"{Binding Settings.DefaultCpuAssignmentMode}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("Text=\"{Binding ReservedCpuSetsStatus}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("AutomationProperties.HelpText=\"{DynamicResource SettingsView_ReservedCpuSetsTooltip}\"", serialized, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("ReservedCpuSetsStatus, Mode=TwoWay", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsView_ExposesAllSupportedLanguageSelections()
|
||||
@@ -258,6 +258,26 @@ namespace ThreadPilot.Core.Tests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsView_ExposesLocalizedDiscordAndIssueActions()
|
||||
{
|
||||
var settingsViewPath = Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"Views",
|
||||
"SettingsView.xaml");
|
||||
var serialized = File.ReadAllText(settingsViewPath);
|
||||
|
||||
Assert.Contains("SettingsView_SomethingWrong", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("OpenDiscordCommand", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("ReportIssueCommand", serialized, StringComparison.Ordinal);
|
||||
Assert.Contains("SettingsView_ReportIssue", serialized, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private sealed class Harness
|
||||
{
|
||||
private readonly ApplicationSettingsModel settings;
|
||||
|
||||
@@ -19,5 +19,29 @@ namespace ThreadPilot.Core.Tests
|
||||
|
||||
Assert.Equal("Medium", value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPointerPrecisionValues_WhenDisabled_ClearsAccelerationAndThresholds()
|
||||
{
|
||||
var values = SystemTweaksService.GetPointerPrecisionValues(enabled: false, [6, 10, 1]);
|
||||
|
||||
Assert.Equal([0, 0, 0], values);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPointerPrecisionValues_WhenEnabled_RestoresWindowsDefaultsAfterDisable()
|
||||
{
|
||||
var values = SystemTweaksService.GetPointerPrecisionValues(enabled: true, [0, 0, 0]);
|
||||
|
||||
Assert.Equal([6, 10, 1], values);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPointerPrecisionValues_WhenEnabled_PreservesExistingNonZeroValues()
|
||||
{
|
||||
var values = SystemTweaksService.GetPointerPrecisionValues(enabled: true, [4, 8, 2]);
|
||||
|
||||
Assert.Equal([4, 8, 2], values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,15 @@ namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
var harness = new Harness();
|
||||
var status = new TweakStatus { IsEnabled = true, IsAvailable = true };
|
||||
harness.Tweaks.Setup(service => service.GetGameModeStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetCoreParkingStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetCStatesStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetMemoryIntegrityStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetUsbSelectiveSuspendStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetPointerPrecisionStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetEthernetPowerSavingStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetInterruptModerationStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetGpuMsiModeStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetSysMainStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetPrefetchStatusAsync()).ReturnsAsync(status);
|
||||
harness.Tweaks.Setup(service => service.GetPowerThrottlingStatusAsync()).ReturnsAsync(status);
|
||||
@@ -24,9 +31,17 @@ namespace ThreadPilot.Core.Tests
|
||||
await viewModel.LoadAsync();
|
||||
|
||||
Assert.Equal(Enum.GetValues<SystemTweak>().Length, viewModel.TweakItems.Count);
|
||||
Assert.All(viewModel.TweakItems, item => Assert.True(item.IsEnabled));
|
||||
Assert.All(viewModel.TweakItems.Where(item => !item.IsGuidedAction), item => Assert.True(item.IsEnabled));
|
||||
Assert.All(viewModel.TweakItems, item => Assert.True(item.IsAvailable));
|
||||
harness.Tweaks.Verify(service => service.GetGameModeStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetCoreParkingStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetCStatesStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetMemoryIntegrityStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetUsbSelectiveSuspendStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetPointerPrecisionStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetEthernetPowerSavingStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetInterruptModerationStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetGpuMsiModeStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetSysMainStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetPrefetchStatusAsync(), Times.Once);
|
||||
harness.Tweaks.Verify(service => service.GetPowerThrottlingStatusAsync(), Times.Once);
|
||||
@@ -35,8 +50,14 @@ namespace ThreadPilot.Core.Tests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(SystemTweak.GameMode, "Game Mode")]
|
||||
[InlineData(SystemTweak.CoreParking, "Core Parking")]
|
||||
[InlineData(SystemTweak.CStates, "C-States")]
|
||||
[InlineData(SystemTweak.UsbSelectiveSuspend, "USB Selective Suspend")]
|
||||
[InlineData(SystemTweak.PointerPrecision, "Enhance pointer precision")]
|
||||
[InlineData(SystemTweak.EthernetPowerSaving, "Disable Ethernet power saving")]
|
||||
[InlineData(SystemTweak.InterruptModeration, "Disable interrupt moderation")]
|
||||
[InlineData(SystemTweak.GpuMsiMode, "GPU MSI Mode")]
|
||||
[InlineData(SystemTweak.SysMain, "SysMain Service")]
|
||||
[InlineData(SystemTweak.Prefetch, "Prefetch")]
|
||||
[InlineData(SystemTweak.PowerThrottling, "Power Throttling")]
|
||||
@@ -109,6 +130,10 @@ namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
switch (tweakType)
|
||||
{
|
||||
case SystemTweak.GameMode:
|
||||
this.Tweaks.Setup(service => service.SetGameModeAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetGameModeStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.CoreParking:
|
||||
this.Tweaks.Setup(service => service.SetCoreParkingAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetCoreParkingStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
@@ -117,6 +142,26 @@ namespace ThreadPilot.Core.Tests
|
||||
this.Tweaks.Setup(service => service.SetCStatesAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetCStatesStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.UsbSelectiveSuspend:
|
||||
this.Tweaks.Setup(service => service.SetUsbSelectiveSuspendAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetUsbSelectiveSuspendStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.PointerPrecision:
|
||||
this.Tweaks.Setup(service => service.SetPointerPrecisionAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetPointerPrecisionStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.EthernetPowerSaving:
|
||||
this.Tweaks.Setup(service => service.SetEthernetPowerSavingAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetEthernetPowerSavingStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.InterruptModeration:
|
||||
this.Tweaks.Setup(service => service.SetInterruptModerationAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetInterruptModerationStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.GpuMsiMode:
|
||||
this.Tweaks.Setup(service => service.SetGpuMsiModeAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetGpuMsiModeStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
break;
|
||||
case SystemTweak.SysMain:
|
||||
this.Tweaks.Setup(service => service.SetSysMainAsync(true)).ReturnsAsync(setResult);
|
||||
this.Tweaks.Setup(service => service.GetSysMainStatusAsync()).ReturnsAsync(CreateEnabledStatus());
|
||||
@@ -146,12 +191,30 @@ namespace ThreadPilot.Core.Tests
|
||||
{
|
||||
switch (tweakType)
|
||||
{
|
||||
case SystemTweak.GameMode:
|
||||
this.Tweaks.Verify(service => service.SetGameModeAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.CoreParking:
|
||||
this.Tweaks.Verify(service => service.SetCoreParkingAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.CStates:
|
||||
this.Tweaks.Verify(service => service.SetCStatesAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.UsbSelectiveSuspend:
|
||||
this.Tweaks.Verify(service => service.SetUsbSelectiveSuspendAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.PointerPrecision:
|
||||
this.Tweaks.Verify(service => service.SetPointerPrecisionAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.EthernetPowerSaving:
|
||||
this.Tweaks.Verify(service => service.SetEthernetPowerSavingAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.InterruptModeration:
|
||||
this.Tweaks.Verify(service => service.SetInterruptModerationAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.GpuMsiMode:
|
||||
this.Tweaks.Verify(service => service.SetGpuMsiModeAsync(true), Times.Once);
|
||||
break;
|
||||
case SystemTweak.SysMain:
|
||||
this.Tweaks.Verify(service => service.SetSysMainAsync(true), Times.Once);
|
||||
break;
|
||||
|
||||
+4
-13
@@ -16,10 +16,10 @@
|
||||
<TrimMode>link</TrimMode>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn>CS1998;CS0067;CS0414;WFAC010;IL3000;MVVMTK0034</NoWarn>
|
||||
<Version>1.6.0</Version>
|
||||
<AssemblyVersion>1.6.0.0</AssemblyVersion>
|
||||
<FileVersion>1.6.0.0</FileVersion>
|
||||
<InformationalVersion>1.6.0</InformationalVersion>
|
||||
<Version>1.7.0</Version>
|
||||
<AssemblyVersion>1.7.0.0</AssemblyVersion>
|
||||
<FileVersion>1.7.0.0</FileVersion>
|
||||
<InformationalVersion>1.7.0</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -36,15 +36,6 @@
|
||||
<Resource Include="assets\icons\ico.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Include bundled power plans in build output -->
|
||||
<ItemGroup>
|
||||
<Content Include="assets\Powerplans\**\*.pow">
|
||||
<TargetPath>Powerplans\%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Ensure XAML for ProcessPowerPlanAssociationView generates InitializeComponent -->
|
||||
<ItemGroup>
|
||||
<Page Update="Views/ProcessPowerPlanAssociationView.xaml">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace ThreadPilot.ViewModels
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
@@ -104,6 +105,18 @@ namespace ThreadPilot.ViewModels
|
||||
this.HasError = false;
|
||||
}
|
||||
|
||||
protected void OpenExternalLink(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.SetError("Unable to open the link.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ExecuteAsync(Func<Task> operation, string? statusMessage = null, string? successMessage = null)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
public partial class PowerPlanViewModel : BaseViewModel
|
||||
{
|
||||
internal const string MorePlansUrl = "https://discord.gg/EmPfb57Kfr";
|
||||
private readonly IPowerPlanService powerPlanService;
|
||||
private System.Timers.Timer? refreshTimer;
|
||||
private bool isAutoRefreshPaused = true;
|
||||
@@ -133,6 +134,9 @@ namespace ThreadPilot.ViewModels
|
||||
});
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenMorePlans() => this.OpenExternalLink(MorePlansUrl);
|
||||
|
||||
[RelayCommand]
|
||||
public async Task LoadPowerPlans()
|
||||
{
|
||||
|
||||
@@ -145,24 +145,24 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnSelectedProcessChanged(ProcessModel? value)
|
||||
{
|
||||
this.SetCpuAssignmentMode(
|
||||
this.settingsService?.Settings.DefaultCpuAssignmentMode ?? CpuAssignmentMode.Automatic,
|
||||
overriddenByRule: false);
|
||||
this.UpdateSelectedProcessSummary(value);
|
||||
partial void OnSelectedProcessChanged(ProcessModel? value)
|
||||
{
|
||||
this.SetCpuAssignmentMode(
|
||||
this.settingsService?.Settings.DefaultCpuAssignmentMode ?? CpuAssignmentMode.Automatic,
|
||||
overriddenByRule: false);
|
||||
this.UpdateSelectedProcessSummary(value);
|
||||
|
||||
if (value != null && CpuTopology != null)
|
||||
{
|
||||
this.HasPendingAffinityEdits = false;
|
||||
this.UpdateAffinityDisplayState();
|
||||
// Immediately fetch and display real-time process information
|
||||
TaskSafety.FireAndForget(HandleSelectedProcessChangedAsync(value), ex =>
|
||||
TaskSafety.FireAndForget(HandleSelectedProcessChangedAsync(value), ex =>
|
||||
{
|
||||
this.Logger.LogWarning(ex, "Failed while handling selected process change for {ProcessName}", value.Name);
|
||||
});
|
||||
TaskSafety.FireAndForget(this.ResolveCpuAssignmentModeAsync(value), ex =>
|
||||
this.Logger.LogDebug(ex, "Could not resolve saved CPU assignment mode for {ProcessName}", value.Name));
|
||||
});
|
||||
TaskSafety.FireAndForget(this.ResolveCpuAssignmentModeAsync(value), ex =>
|
||||
this.Logger.LogDebug(ex, "Could not resolve saved CPU assignment mode for {ProcessName}", value.Name));
|
||||
}
|
||||
else if (value == null)
|
||||
{
|
||||
@@ -172,39 +172,39 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
// Update system tray context menu
|
||||
this.systemTrayService.UpdateContextMenu(value?.Name, value != null);
|
||||
}
|
||||
|
||||
partial void OnSelectedCpuAssignmentModeChanged(CpuAssignmentMode value)
|
||||
{
|
||||
if (!this.suppressCpuAssignmentModeChanges && this.SelectedProcess != null)
|
||||
{
|
||||
this.HasPendingAffinityEdits = true;
|
||||
this.cpuAssignmentModeOverriddenByRule = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ResolveCpuAssignmentModeAsync(ProcessModel process)
|
||||
{
|
||||
if (this.persistentRuleStore == null || this.persistentRuleMatcher == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var rules = await this.persistentRuleStore.LoadAsync().ConfigureAwait(false);
|
||||
var rule = rules.FirstOrDefault(candidate => candidate.IsEnabled && this.persistentRuleMatcher.IsMatch(candidate, process));
|
||||
if (rule != null && this.SelectedProcess?.ProcessId == process.ProcessId)
|
||||
{
|
||||
await InvokeOnUiAsync(() => this.SetCpuAssignmentMode(rule.CpuAssignmentMode, overriddenByRule: true));
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCpuAssignmentMode(CpuAssignmentMode mode, bool overriddenByRule)
|
||||
{
|
||||
this.suppressCpuAssignmentModeChanges = true;
|
||||
this.SelectedCpuAssignmentMode = Enum.IsDefined(mode) ? mode : CpuAssignmentMode.Automatic;
|
||||
this.suppressCpuAssignmentModeChanges = false;
|
||||
this.cpuAssignmentModeOverriddenByRule = overriddenByRule;
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnSelectedCpuAssignmentModeChanged(CpuAssignmentMode value)
|
||||
{
|
||||
if (!this.suppressCpuAssignmentModeChanges && this.SelectedProcess != null)
|
||||
{
|
||||
this.HasPendingAffinityEdits = true;
|
||||
this.cpuAssignmentModeOverriddenByRule = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ResolveCpuAssignmentModeAsync(ProcessModel process)
|
||||
{
|
||||
if (this.persistentRuleStore == null || this.persistentRuleMatcher == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var rules = await this.persistentRuleStore.LoadAsync().ConfigureAwait(false);
|
||||
var rule = rules.FirstOrDefault(candidate => candidate.IsEnabled && this.persistentRuleMatcher.IsMatch(candidate, process));
|
||||
if (rule != null && this.SelectedProcess?.ProcessId == process.ProcessId)
|
||||
{
|
||||
await InvokeOnUiAsync(() => this.SetCpuAssignmentMode(rule.CpuAssignmentMode, overriddenByRule: true));
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCpuAssignmentMode(CpuAssignmentMode mode, bool overriddenByRule)
|
||||
{
|
||||
this.suppressCpuAssignmentModeChanges = true;
|
||||
this.SelectedCpuAssignmentMode = Enum.IsDefined(mode) ? mode : CpuAssignmentMode.Automatic;
|
||||
this.suppressCpuAssignmentModeChanges = false;
|
||||
this.cpuAssignmentModeOverriddenByRule = overriddenByRule;
|
||||
}
|
||||
|
||||
private void UpdateSelectedProcessSummary(ProcessModel? process)
|
||||
{
|
||||
@@ -546,7 +546,7 @@ namespace ThreadPilot.ViewModels
|
||||
this.PendingAffinityText = pendingMask > 0
|
||||
? $"Pending core mask: 0x{pendingMask:X}"
|
||||
: "Pending core mask: no cores selected";
|
||||
this.AffinityEditStateText = "CPU selection staged. Use Apply CPU Assignment to apply it.";
|
||||
this.AffinityEditStateText = "CPU selection staged. Use Apply CPU Assignment to apply it.";
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -813,11 +813,13 @@ namespace ThreadPilot.ViewModels
|
||||
var currentCoreSelection = this.HasPendingAffinityEdits && this.CpuCores.Count > 0
|
||||
? this.GetPendingCoreSelectionMask()
|
||||
: null;
|
||||
var result = await this.processRuleCreationService.SaveCurrentSettingsAsRuleAsync(
|
||||
targetProcess,
|
||||
currentCoreSelection,
|
||||
this.SelectedProcessSummary.MemoryPriority,
|
||||
this.SelectedCpuAssignmentMode);
|
||||
var result = await this.processRuleCreationService.SaveCurrentSettingsAsRuleAsync(
|
||||
targetProcess,
|
||||
currentCoreSelection,
|
||||
this.SelectedProcessSummary.MemoryPriority,
|
||||
this.SelectedCpuAssignmentMode,
|
||||
this.SelectedProcessSummary.IoPriority,
|
||||
this.IsIdleServerDisabled);
|
||||
|
||||
this.ApplyRuleCreationResultStatus(result);
|
||||
await this.LogUserActionAsync(
|
||||
@@ -848,24 +850,24 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
|
||||
var pendingSelection = this.GetPendingCoreSelectionMask();
|
||||
var applyResult = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
process,
|
||||
pendingSelection,
|
||||
"Manual Process tab context menu CPU selection",
|
||||
this.SelectedCpuAssignmentMode);
|
||||
var applyResult = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
process,
|
||||
pendingSelection,
|
||||
"Manual Process tab context menu CPU selection",
|
||||
this.SelectedCpuAssignmentMode);
|
||||
|
||||
if (!applyResult.Success)
|
||||
{
|
||||
this.SetContextError(applyResult.Message);
|
||||
await this.LogUserActionAsync(
|
||||
"ProcessCpuAssignmentFailed",
|
||||
applyResult.Message,
|
||||
$"Process: {process.Name}, PID: {process.ProcessId}, RequestedMode: {applyResult.RequestedMode}, EffectiveMode: {applyResult.EffectiveMode}, RequestedMask: 0x{applyResult.RequestedMask:X}");
|
||||
"ProcessCpuAssignmentFailed",
|
||||
applyResult.Message,
|
||||
$"Process: {process.Name}, PID: {process.ProcessId}, RequestedMode: {applyResult.RequestedMode}, EffectiveMode: {applyResult.EffectiveMode}, RequestedMask: 0x{applyResult.RequestedMask:X}");
|
||||
await this.UpdateSelectedProcessSummaryAsync(process);
|
||||
return;
|
||||
}
|
||||
|
||||
if (applyResult.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
if (applyResult.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
{
|
||||
this.UpdateCoreSelections(process.ProcessorAffinity, true);
|
||||
}
|
||||
@@ -875,11 +877,13 @@ namespace ThreadPilot.ViewModels
|
||||
this.HasPendingAffinityEdits = false;
|
||||
this.UpdateAffinityDisplayState();
|
||||
|
||||
var saveResult = await this.processRuleCreationService.SaveCurrentSettingsAsRuleAsync(
|
||||
process,
|
||||
pendingSelection,
|
||||
currentMemoryPriority: null,
|
||||
cpuAssignmentMode: this.SelectedCpuAssignmentMode);
|
||||
var saveResult = await this.processRuleCreationService.SaveCurrentSettingsAsRuleAsync(
|
||||
process,
|
||||
pendingSelection,
|
||||
currentMemoryPriority: null,
|
||||
cpuAssignmentMode: this.SelectedCpuAssignmentMode,
|
||||
currentIoPriority: null,
|
||||
preventSystemSleepWhileRunning: this.IsIdleServerDisabled);
|
||||
|
||||
this.ApplyRuleCreationResultStatus(saveResult);
|
||||
await this.LogUserActionAsync(
|
||||
@@ -913,15 +917,15 @@ namespace ThreadPilot.ViewModels
|
||||
this.SetStatus($"Setting affinity for {selectedProcess.Name}...");
|
||||
});
|
||||
|
||||
var result = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
selectedProcess,
|
||||
pendingSelection,
|
||||
selectionReason,
|
||||
this.SelectedCpuAssignmentMode);
|
||||
var result = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
selectedProcess,
|
||||
pendingSelection,
|
||||
selectionReason,
|
||||
this.SelectedCpuAssignmentMode);
|
||||
|
||||
await InvokeOnUiAsync(() =>
|
||||
{
|
||||
if (result.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
if (result.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
{
|
||||
this.UpdateCoreSelections(selectedProcess.ProcessorAffinity, true);
|
||||
}
|
||||
@@ -933,58 +937,58 @@ namespace ThreadPilot.ViewModels
|
||||
{
|
||||
this.HasPendingAffinityEdits = false;
|
||||
this.UpdateAffinityDisplayState();
|
||||
this.SetStatus($"CPU assignment applied successfully to {selectedProcess.Name} using {result.EffectiveMode}.", false);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment applied", $"{selectedProcess.Name}: {result.EffectiveMode}", NotificationType.Success);
|
||||
this.SetStatus($"CPU assignment applied successfully to {selectedProcess.Name} using {result.EffectiveMode}.", false);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment applied", $"{selectedProcess.Name}: {result.EffectiveMode}", NotificationType.Success);
|
||||
}
|
||||
else if (result.FailureReason == AffinityApplyFailureReason.VerificationMismatch)
|
||||
{
|
||||
this.HasPendingAffinityEdits = false;
|
||||
this.UpdateAffinityDisplayState();
|
||||
this.SetStatus(result.Message, false);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment adjusted", result.Message, NotificationType.Warning);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment adjusted", result.Message, NotificationType.Warning);
|
||||
}
|
||||
else if (result.FailureReason == AffinityApplyFailureReason.ProcessTerminated)
|
||||
{
|
||||
this.SelectedProcess = null;
|
||||
this.ClearProcessSelection();
|
||||
this.SetCriticalStatus(result.Message);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment failed", result.Message, NotificationType.Warning);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment failed", result.Message, NotificationType.Warning);
|
||||
}
|
||||
else if (result.FailureReason == AffinityApplyFailureReason.AccessDenied)
|
||||
{
|
||||
this.SetCriticalStatus(result.Message);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment blocked", result.Message, NotificationType.Warning);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment blocked", result.Message, NotificationType.Warning);
|
||||
}
|
||||
else if (result.IsInvalidTopology || result.IsLegacyFallbackBlocked)
|
||||
{
|
||||
this.SetCriticalStatus(result.Message);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment blocked", result.Message, NotificationType.Warning);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment blocked", result.Message, NotificationType.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SetStatus(result.Message, false);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment error", result.Message, NotificationType.Error);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment error", result.Message, NotificationType.Error);
|
||||
}
|
||||
});
|
||||
|
||||
await this.LogUserActionAsync(
|
||||
result.Success ? "ProcessCpuAssignmentApplied" : "ProcessCpuAssignmentFailed",
|
||||
result.Message,
|
||||
$"Process: {selectedProcess.Name}, PID: {selectedProcess.ProcessId}, RequestedMode: {result.RequestedMode}, EffectiveMode: {result.EffectiveMode}, Threads: {result.AppliedThreadCount}, RequestedMask: 0x{result.RequestedMask:X}, VerifiedMask: 0x{result.VerifiedMask:X}");
|
||||
result.Success ? "ProcessCpuAssignmentApplied" : "ProcessCpuAssignmentFailed",
|
||||
result.Message,
|
||||
$"Process: {selectedProcess.Name}, PID: {selectedProcess.ProcessId}, RequestedMode: {result.RequestedMode}, EffectiveMode: {result.EffectiveMode}, Threads: {result.AppliedThreadCount}, RequestedMask: 0x{result.RequestedMask:X}, VerifiedMask: 0x{result.VerifiedMask:X}");
|
||||
await this.UpdateSelectedProcessSummaryAsync(selectedProcess);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var friendly = ex.Message;
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment error", friendly, NotificationType.Error);
|
||||
_ = this.notificationService.ShowNotificationAsync("CPU assignment error", friendly, NotificationType.Error);
|
||||
await this.LogUserActionAsync(
|
||||
"ProcessCpuAssignmentFailed",
|
||||
friendly,
|
||||
$"Process: {selectedProcess.Name}, PID: {selectedProcess.ProcessId}, Mode: {this.SelectedCpuAssignmentMode}");
|
||||
"ProcessCpuAssignmentFailed",
|
||||
friendly,
|
||||
$"Process: {selectedProcess.Name}, PID: {selectedProcess.ProcessId}, Mode: {this.SelectedCpuAssignmentMode}");
|
||||
|
||||
await InvokeOnUiAsync(() =>
|
||||
{
|
||||
this.SetCriticalStatus($"Error applying CPU assignment: {friendly}");
|
||||
this.SetCriticalStatus($"Error applying CPU assignment: {friendly}");
|
||||
});
|
||||
|
||||
// Try to refresh process info even if setting failed, to show current state
|
||||
@@ -1148,10 +1152,6 @@ namespace ThreadPilot.ViewModels
|
||||
"Applying mask '{MaskName}' to process {ProcessName} (PID: {ProcessId})",
|
||||
mask.Name, selectedProcess.Name, selectedProcess.ProcessId);
|
||||
|
||||
// Disable Windows Game Mode for better CPU affinity control
|
||||
// Game Mode can interfere with CPU Sets, particularly on AMD systems
|
||||
await this.gameModeService.DisableGameModeForAffinityAsync();
|
||||
|
||||
var result = await this.processAffinityApplyCoordinator.ApplyCoreMaskAsync(selectedProcess, mask);
|
||||
|
||||
System.Windows.Application.Current.Dispatcher.Invoke(() =>
|
||||
@@ -1231,7 +1231,7 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
try
|
||||
{
|
||||
var affinityModeChangedOsAffinity = false;
|
||||
var affinityModeChangedOsAffinity = false;
|
||||
|
||||
await System.Windows.Application.Current.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
@@ -1242,16 +1242,16 @@ namespace ThreadPilot.ViewModels
|
||||
var pendingSelection = this.GetPendingCoreSelectionMask();
|
||||
if (pendingSelection.Any(selected => selected))
|
||||
{
|
||||
var result = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
selectedProcess,
|
||||
pendingSelection,
|
||||
"Manual Process tab quick apply CPU selection",
|
||||
this.SelectedCpuAssignmentMode);
|
||||
var result = await this.processAffinityApplyCoordinator.ApplyCoreSelectionAsync(
|
||||
selectedProcess,
|
||||
pendingSelection,
|
||||
"Manual Process tab quick apply CPU selection",
|
||||
this.SelectedCpuAssignmentMode);
|
||||
if (!result.Success)
|
||||
{
|
||||
await System.Windows.Application.Current.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
if (result.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
if (result.EffectiveMode == CpuAssignmentMode.AffinityMask)
|
||||
{
|
||||
this.UpdateCoreSelections(selectedProcess.ProcessorAffinity, true);
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
this.HasPendingAffinityEdits = false;
|
||||
this.UpdateAffinityDisplayState();
|
||||
affinityModeChangedOsAffinity = result.EffectiveMode == CpuAssignmentMode.AffinityMask;
|
||||
affinityModeChangedOsAffinity = result.EffectiveMode == CpuAssignmentMode.AffinityMask;
|
||||
}
|
||||
|
||||
// Apply power plan if selected
|
||||
@@ -1278,7 +1278,7 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
await System.Windows.Application.Current.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
if (affinityModeChangedOsAffinity)
|
||||
if (affinityModeChangedOsAffinity)
|
||||
{
|
||||
this.UpdateCoreSelections(selectedProcess.ProcessorAffinity, true);
|
||||
}
|
||||
@@ -1531,6 +1531,22 @@ namespace ThreadPilot.ViewModels
|
||||
private Task SetContextMemoryPriorityNormal(ProcessModel? process) =>
|
||||
this.SetContextMemoryPriorityAsync(process, ProcessMemoryPriority.Normal);
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetContextIoPriorityVeryLow(ProcessModel? process) =>
|
||||
this.SetContextIoPriorityAsync(process, ProcessIoPriority.VeryLow);
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetContextIoPriorityLow(ProcessModel? process) =>
|
||||
this.SetContextIoPriorityAsync(process, ProcessIoPriority.Low);
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetContextIoPriorityNormal(ProcessModel? process) =>
|
||||
this.SetContextIoPriorityAsync(process, ProcessIoPriority.Normal);
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetContextIoPriorityHigh(ProcessModel? process) =>
|
||||
this.SetContextIoPriorityAsync(process, ProcessIoPriority.High);
|
||||
|
||||
[RelayCommand]
|
||||
private async Task ClearContextCpuSets(ProcessModel? process)
|
||||
{
|
||||
@@ -1665,6 +1681,7 @@ namespace ThreadPilot.ViewModels
|
||||
.AppendLine($"Path: {path}")
|
||||
.AppendLine($"CPU priority: {process.Priority}")
|
||||
.AppendLine($"Memory priority: {this.SelectedProcessSummary.MemoryPriority?.ToString() ?? "unavailable"}")
|
||||
.AppendLine($"I/O priority: {this.SelectedProcessSummary.IoPriority?.ToString() ?? "unavailable"}")
|
||||
.AppendLine($"Affinity: 0x{process.ProcessorAffinity:X}")
|
||||
.AppendLine($"Rule status: {this.SelectedProcessSummary.RuleStatusText}");
|
||||
|
||||
@@ -1794,6 +1811,33 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SetContextIoPriorityAsync(ProcessModel? process, ProcessIoPriority priority)
|
||||
{
|
||||
if (process == null || this.memoryPriorityService == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await this.memoryPriorityService.SetIoPriorityAsync(process, priority);
|
||||
if (!result.Success)
|
||||
{
|
||||
this.SetContextError(result.UserMessage);
|
||||
await this.LogUserActionAsync(
|
||||
"ProcessIoPriorityFailed",
|
||||
result.UserMessage,
|
||||
$"Process: {process.Name}, PID: {process.ProcessId}, Priority: {priority}");
|
||||
await this.UpdateSelectedProcessSummaryAsync(process);
|
||||
return;
|
||||
}
|
||||
|
||||
this.SetStatus($"I/O priority applied successfully to {process.Name}: {priority}.", false);
|
||||
await this.LogUserActionAsync(
|
||||
"ProcessIoPriorityChanged",
|
||||
$"I/O priority changed for {process.Name}: {priority}",
|
||||
$"PID: {process.ProcessId}");
|
||||
await this.UpdateSelectedProcessSummaryAsync(process);
|
||||
}
|
||||
|
||||
private async Task TryRefreshContextProcessSummaryAsync(ProcessModel process)
|
||||
{
|
||||
try
|
||||
@@ -2230,32 +2274,30 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
try
|
||||
{
|
||||
this.SetStatus($"{(disable ? "Disabling" : "Enabling")} idle server for {this.SelectedProcess.Name}...");
|
||||
|
||||
// Implementation for disabling/enabling idle server
|
||||
// This typically involves setting process execution state or power management settings
|
||||
var success = await this.processService.SetIdleServerStateAsync(this.SelectedProcess, !disable);
|
||||
this.SetStatus($"{(disable ? "Enabling" : "Disabling")} sleep prevention for {this.SelectedProcess.Name}...");
|
||||
var success = this.powerRequestService != null &&
|
||||
await this.powerRequestService.SetPreventSleepAsync(this.SelectedProcess, disable);
|
||||
|
||||
if (success)
|
||||
{
|
||||
this.SelectedProcess.IsIdleServerDisabled = disable;
|
||||
this.SetStatus($"Idle server {(disable ? "disabled" : "enabled")} for {this.SelectedProcess.Name}");
|
||||
this.SetStatus($"Sleep prevention {(disable ? "enabled" : "disabled")} for {this.SelectedProcess.Name}");
|
||||
|
||||
await this.LogUserActionAsync(
|
||||
"IdleServer",
|
||||
$"Idle server {(disable ? "disabled" : "enabled")} for process {this.SelectedProcess.Name}",
|
||||
"ProcessSleepPrevention",
|
||||
$"Sleep prevention {(disable ? "enabled" : "disabled")} for process {this.SelectedProcess.Name}",
|
||||
$"PID: {this.SelectedProcess.ProcessId}");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SetStatus($"Failed to {(disable ? "disable" : "enable")} idle server for {this.SelectedProcess.Name}", false);
|
||||
this.SetStatus($"Failed to {(disable ? "enable" : "disable")} sleep prevention for {this.SelectedProcess.Name}", false);
|
||||
// Revert the UI state
|
||||
this.IsIdleServerDisabled = !disable;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Logger.LogError(ex, "Error toggling idle server for process {ProcessName}", this.SelectedProcess.Name);
|
||||
this.Logger.LogError(ex, "Error toggling sleep prevention for process {ProcessName}", this.SelectedProcess.Name);
|
||||
this.SetStatus($"Error: {ex.Message}", false);
|
||||
// Revert the UI state
|
||||
this.IsIdleServerDisabled = !disable;
|
||||
|
||||
@@ -32,10 +32,11 @@ namespace ThreadPilot.ViewModels
|
||||
private readonly IAffinityApplyService affinityApplyService;
|
||||
private readonly IProcessAffinityApplyCoordinator processAffinityApplyCoordinator;
|
||||
private readonly IProcessMemoryPriorityService? memoryPriorityService;
|
||||
private readonly ProcessPowerRequestService? powerRequestService;
|
||||
private readonly IProcessRuleCreationService? processRuleCreationService;
|
||||
private readonly IApplicationSettingsService? settingsService;
|
||||
private readonly IPersistentProcessRuleStore? persistentRuleStore;
|
||||
private readonly IPersistentProcessRuleMatcher? persistentRuleMatcher;
|
||||
private readonly IApplicationSettingsService? settingsService;
|
||||
private readonly IPersistentProcessRuleStore? persistentRuleStore;
|
||||
private readonly IPersistentProcessRuleMatcher? persistentRuleMatcher;
|
||||
private readonly Action<string> clipboardSetter;
|
||||
private readonly Action<string> executableLocationOpener;
|
||||
private System.Timers.Timer? refreshTimer;
|
||||
@@ -47,9 +48,9 @@ namespace ThreadPilot.ViewModels
|
||||
private readonly ThrottledRefreshCoordinator filterRefreshCoordinator;
|
||||
private bool isApplyingFilter;
|
||||
private bool filterRefreshPending;
|
||||
private bool suppressCoreSelectionEvents;
|
||||
private bool suppressCpuAssignmentModeChanges;
|
||||
private bool cpuAssignmentModeOverriddenByRule;
|
||||
private bool suppressCoreSelectionEvents;
|
||||
private bool suppressCpuAssignmentModeChanges;
|
||||
private bool cpuAssignmentModeOverriddenByRule;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isAutomationMonitoringEnabled = true;
|
||||
@@ -105,10 +106,10 @@ namespace ThreadPilot.ViewModels
|
||||
private string topologyStatus = "Detecting CPU topology...";
|
||||
|
||||
[ObservableProperty]
|
||||
private bool areAdvancedFeaturesAvailable = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private CpuAssignmentMode selectedCpuAssignmentMode = CpuAssignmentMode.Automatic;
|
||||
private bool areAdvancedFeaturesAvailable = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private CpuAssignmentMode selectedCpuAssignmentMode = CpuAssignmentMode.Automatic;
|
||||
|
||||
[ObservableProperty]
|
||||
private PowerPlanModel? selectedPowerPlan;
|
||||
@@ -194,7 +195,8 @@ namespace ThreadPilot.ViewModels
|
||||
Action<string>? clipboardSetter = null,
|
||||
Action<string>? executableLocationOpener = null,
|
||||
ILocalizationService? localizationService = null,
|
||||
IApplicationSettingsService? settingsService = null)
|
||||
IApplicationSettingsService? settingsService = null,
|
||||
ProcessPowerRequestService? powerRequestService = null)
|
||||
: base(logger, enhancedLoggingService, activityAuditService)
|
||||
{
|
||||
this.processService = processService ?? throw new ArgumentNullException(nameof(processService));
|
||||
@@ -217,10 +219,11 @@ namespace ThreadPilot.ViewModels
|
||||
new CpuSelectionMigrationService(),
|
||||
NullLogger<ProcessAffinityApplyCoordinator>.Instance);
|
||||
this.memoryPriorityService = memoryPriorityService;
|
||||
this.settingsService = settingsService;
|
||||
this.persistentRuleStore = persistentRuleStore;
|
||||
this.persistentRuleMatcher = persistentRuleMatcher;
|
||||
this.SelectedCpuAssignmentMode = settingsService?.Settings.DefaultCpuAssignmentMode ?? CpuAssignmentMode.Automatic;
|
||||
this.powerRequestService = powerRequestService;
|
||||
this.settingsService = settingsService;
|
||||
this.persistentRuleStore = persistentRuleStore;
|
||||
this.persistentRuleMatcher = persistentRuleMatcher;
|
||||
this.SelectedCpuAssignmentMode = settingsService?.Settings.DefaultCpuAssignmentMode ?? CpuAssignmentMode.Automatic;
|
||||
this.IsAutomationMonitoringEnabled = settingsService?.Settings.EnableAutomationMonitoring ?? true;
|
||||
if (settingsService != null)
|
||||
{
|
||||
@@ -265,11 +268,11 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
private void OnSettingsChanged(object? sender, ApplicationSettingsChangedEventArgs e)
|
||||
{
|
||||
this.IsAutomationMonitoringEnabled = e.NewSettings.EnableAutomationMonitoring;
|
||||
if (!this.cpuAssignmentModeOverriddenByRule)
|
||||
{
|
||||
this.SetCpuAssignmentMode(e.NewSettings.DefaultCpuAssignmentMode, overriddenByRule: false);
|
||||
}
|
||||
this.IsAutomationMonitoringEnabled = e.NewSettings.EnableAutomationMonitoring;
|
||||
if (!this.cpuAssignmentModeOverriddenByRule)
|
||||
{
|
||||
this.SetCpuAssignmentMode(e.NewSettings.DefaultCpuAssignmentMode, overriddenByRule: false);
|
||||
}
|
||||
if (!this.IsAutomationMonitoringEnabled)
|
||||
{
|
||||
this.SetUiRefreshEnabled(false, refreshImmediately: false);
|
||||
|
||||
@@ -24,12 +24,14 @@ namespace ThreadPilot.ViewModels
|
||||
private ProcessPriorityClass cpuPriority;
|
||||
private long processorAffinity;
|
||||
private ProcessMemoryPriority? memoryPriority;
|
||||
private ProcessIoPriority? ioPriority;
|
||||
private string processTitle = "No process selected";
|
||||
private string currentProcessStatusText = "No process selected";
|
||||
private string cpuUsageText = "CPU: unavailable";
|
||||
private string memoryUsageText = "Memory: unavailable";
|
||||
private string cpuPriorityText = "CPU priority: unavailable";
|
||||
private string memoryPriorityText = "Memory priority unavailable";
|
||||
private string ioPriorityText = "I/O priority unavailable";
|
||||
private string affinityText = "Affinity: unavailable";
|
||||
private string ruleStatusText = "No saved rule";
|
||||
private string lastOperationMessage = "No recent ThreadPilot action";
|
||||
@@ -105,6 +107,12 @@ namespace ThreadPilot.ViewModels
|
||||
private set => this.SetProperty(ref this.memoryPriority, value);
|
||||
}
|
||||
|
||||
public ProcessIoPriority? IoPriority
|
||||
{
|
||||
get => this.ioPriority;
|
||||
private set => this.SetProperty(ref this.ioPriority, value);
|
||||
}
|
||||
|
||||
public string ProcessTitle
|
||||
{
|
||||
get => this.processTitle;
|
||||
@@ -141,6 +149,12 @@ namespace ThreadPilot.ViewModels
|
||||
private set => this.SetProperty(ref this.memoryPriorityText, value);
|
||||
}
|
||||
|
||||
public string IoPriorityText
|
||||
{
|
||||
get => this.ioPriorityText;
|
||||
private set => this.SetProperty(ref this.ioPriorityText, value);
|
||||
}
|
||||
|
||||
public string AffinityText
|
||||
{
|
||||
get => this.affinityText;
|
||||
@@ -214,6 +228,12 @@ namespace ThreadPilot.ViewModels
|
||||
return;
|
||||
}
|
||||
|
||||
await this.UpdateIoPriorityAsync(process, version);
|
||||
if (!this.IsCurrentVersion(version))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await this.UpdateRuleStatusAsync(process, version);
|
||||
}
|
||||
|
||||
@@ -244,6 +264,7 @@ namespace ThreadPilot.ViewModels
|
||||
this.CpuPriority = default;
|
||||
this.ProcessorAffinity = 0;
|
||||
this.MemoryPriority = null;
|
||||
this.IoPriority = null;
|
||||
this.IsProtectedOrAccessDenied = false;
|
||||
this.HasThreadPilotRule = false;
|
||||
this.ProcessTitle = this.L("ProcessView_NoProcessSelected", "No process selected");
|
||||
@@ -252,6 +273,7 @@ namespace ThreadPilot.ViewModels
|
||||
this.MemoryUsageText = this.L("ProcessSummary_MemoryUnavailable", "Memory: unavailable");
|
||||
this.CpuPriorityText = this.L("ProcessSummary_CpuPriorityUnavailable", "CPU priority: unavailable");
|
||||
this.MemoryPriorityText = this.L("ProcessSummary_MemoryPriorityUnavailable", "Memory priority unavailable");
|
||||
this.IoPriorityText = this.L("ProcessSummary_IoPriorityUnavailable", "I/O priority unavailable");
|
||||
this.AffinityText = this.L("ProcessSummary_AffinityUnavailable", "Affinity: unavailable");
|
||||
this.RuleStatusText = this.L("ProcessSummary_NoSavedRule", "No saved rule");
|
||||
this.UpdateLastOperation(lastOperationMessage, lastOperationIsError);
|
||||
@@ -295,6 +317,32 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateIoPriorityAsync(ProcessModel process, int version)
|
||||
{
|
||||
this.IoPriority = null;
|
||||
this.IoPriorityText = this.L("ProcessSummary_IoPriorityUnavailable", "I/O priority unavailable");
|
||||
if (this.memoryPriorityService == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var priority = await this.memoryPriorityService.GetIoPriorityAsync(process);
|
||||
if (!this.IsCurrentVersion(version) || priority == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.IoPriority = priority.Value;
|
||||
this.IoPriorityText = this.L("ProcessSummary_IoPriorityFormat", "I/O priority: {0}", priority.Value);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.IoPriority = null;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateRuleStatusAsync(ProcessModel process, int version)
|
||||
{
|
||||
this.HasThreadPilotRule = false;
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
public partial class SettingsViewModel : BaseViewModel
|
||||
{
|
||||
internal const string DiscordUrl = "https://discord.gg/VYwkCbr4vH";
|
||||
internal const string IssuesUrl = "https://github.com/PrimeBuild-pc/ThreadPilot/issues";
|
||||
private readonly IApplicationSettingsService settingsService;
|
||||
private readonly INotificationService notificationService;
|
||||
private readonly IAutostartService autostartService;
|
||||
@@ -31,8 +33,8 @@ namespace ThreadPilot.ViewModels
|
||||
private readonly ISystemTrayService systemTrayService;
|
||||
private readonly IUpdateService updateService;
|
||||
private readonly IApplicationVersionProvider versionProvider;
|
||||
private readonly ILocalizationService localizationService;
|
||||
private readonly ICpuTopologyProvider? cpuTopologyProvider;
|
||||
private readonly ILocalizationService localizationService;
|
||||
private readonly ICpuTopologyProvider? cpuTopologyProvider;
|
||||
private ApplicationSettingsModel savedSettingsSnapshot;
|
||||
private bool isSyncingFromService = false;
|
||||
private bool? appliedThemePreference;
|
||||
@@ -88,11 +90,11 @@ namespace ThreadPilot.ViewModels
|
||||
[ObservableProperty]
|
||||
private string lastUpdateCheckText = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isUpdateAvailable = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private string reservedCpuSetsStatus = string.Empty;
|
||||
[ObservableProperty]
|
||||
private bool isUpdateAvailable = false;
|
||||
|
||||
[ObservableProperty]
|
||||
private string reservedCpuSetsStatus = string.Empty;
|
||||
|
||||
public bool CanDownloadAndInstallUpdate => this.IsUpdateAvailable && !this.IsLoading;
|
||||
|
||||
@@ -108,10 +110,10 @@ namespace ThreadPilot.ViewModels
|
||||
ISystemTrayService systemTrayService,
|
||||
IUpdateService updateService,
|
||||
IApplicationVersionProvider versionProvider,
|
||||
ILocalizationService localizationService,
|
||||
IEnhancedLoggingService? enhancedLoggingService = null,
|
||||
IActivityAuditService? activityAuditService = null,
|
||||
ICpuTopologyProvider? cpuTopologyProvider = null)
|
||||
ILocalizationService localizationService,
|
||||
IEnhancedLoggingService? enhancedLoggingService = null,
|
||||
IActivityAuditService? activityAuditService = null,
|
||||
ICpuTopologyProvider? cpuTopologyProvider = null)
|
||||
: base(logger, enhancedLoggingService, activityAuditService)
|
||||
{
|
||||
this.settingsService = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
|
||||
@@ -124,8 +126,8 @@ namespace ThreadPilot.ViewModels
|
||||
this.systemTrayService = systemTrayService ?? throw new ArgumentNullException(nameof(systemTrayService));
|
||||
this.updateService = updateService ?? throw new ArgumentNullException(nameof(updateService));
|
||||
this.versionProvider = versionProvider ?? throw new ArgumentNullException(nameof(versionProvider));
|
||||
this.localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
|
||||
this.cpuTopologyProvider = cpuTopologyProvider;
|
||||
this.localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
|
||||
this.cpuTopologyProvider = cpuTopologyProvider;
|
||||
|
||||
this.ApplicationVersion = this.versionProvider.DisplayVersion;
|
||||
|
||||
@@ -133,8 +135,8 @@ namespace ThreadPilot.ViewModels
|
||||
this.settings = (ApplicationSettingsModel)this.settingsService.Settings.Clone();
|
||||
this.savedSettingsSnapshot = (ApplicationSettingsModel)this.settings.Clone();
|
||||
this.appliedThemePreference = this.settings.UseDarkTheme;
|
||||
this.LatestUpdateVersion = this.GetLocalizedString("Settings_UpdateNotChecked", "Not checked");
|
||||
this.ReservedCpuSetsStatus = this.GetLocalizedString("SettingsView_ReservedCpuSetsUnknown", "Reserved CPU Sets: status unavailable.");
|
||||
this.LatestUpdateVersion = this.GetLocalizedString("Settings_UpdateNotChecked", "Not checked");
|
||||
this.ReservedCpuSetsStatus = this.GetLocalizedString("SettingsView_ReservedCpuSetsUnknown", "Reserved CPU Sets: status unavailable.");
|
||||
this.UpdateLastCheckedText();
|
||||
|
||||
// Initialize commands
|
||||
@@ -158,36 +160,42 @@ namespace ThreadPilot.ViewModels
|
||||
this.Logger.LogInformation("Settings ViewModel initialized");
|
||||
}
|
||||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
await this.RefreshSettingsAsync();
|
||||
await this.RefreshPowerPlansAsync();
|
||||
await this.RefreshReservedCpuSetsStatusAsync();
|
||||
}
|
||||
|
||||
private async Task RefreshReservedCpuSetsStatusAsync()
|
||||
{
|
||||
if (this.cpuTopologyProvider == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var topology = await this.cpuTopologyProvider.GetTopologySnapshotAsync();
|
||||
this.ReservedCpuSetsStatus = topology.ReservedLogicalProcessorIndexes.Count == 0
|
||||
? this.GetLocalizedString("SettingsView_ReservedCpuSetsNone", "Reserved CPU Sets: none detected.")
|
||||
: this.GetLocalizedString(
|
||||
"SettingsView_ReservedCpuSetsDetectedFormat",
|
||||
"Reserved CPU Sets detected on logical processors: {0}.",
|
||||
string.Join(", ", topology.ReservedLogicalProcessorIndexes));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Logger.LogDebug(ex, "Could not read reserved CPU Set state");
|
||||
this.ReservedCpuSetsStatus = this.GetLocalizedString("SettingsView_ReservedCpuSetsUnknown", "Reserved CPU Sets: status unavailable.");
|
||||
}
|
||||
}
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
await this.RefreshSettingsAsync();
|
||||
await this.RefreshPowerPlansAsync();
|
||||
await this.RefreshReservedCpuSetsStatusAsync();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenDiscord() => this.OpenExternalLink(DiscordUrl);
|
||||
|
||||
[RelayCommand]
|
||||
private void ReportIssue() => this.OpenExternalLink(IssuesUrl);
|
||||
|
||||
private async Task RefreshReservedCpuSetsStatusAsync()
|
||||
{
|
||||
if (this.cpuTopologyProvider == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var topology = await this.cpuTopologyProvider.GetTopologySnapshotAsync();
|
||||
this.ReservedCpuSetsStatus = topology.ReservedLogicalProcessorIndexes.Count == 0
|
||||
? this.GetLocalizedString("SettingsView_ReservedCpuSetsNone", "Reserved CPU Sets: none detected.")
|
||||
: this.GetLocalizedString(
|
||||
"SettingsView_ReservedCpuSetsDetectedFormat",
|
||||
"Reserved CPU Sets detected on logical processors: {0}.",
|
||||
string.Join(", ", topology.ReservedLogicalProcessorIndexes));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Logger.LogDebug(ex, "Could not read reserved CPU Set state");
|
||||
this.ReservedCpuSetsStatus = this.GetLocalizedString("SettingsView_ReservedCpuSetsUnknown", "Reserved CPU Sets: status unavailable.");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSettingsPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace ThreadPilot.ViewModels
|
||||
Enum.GetValues<SystemTweak>().Select(type => new SystemTweakItem
|
||||
{
|
||||
TweakType = type,
|
||||
IsGuidedAction = type is SystemTweak.MemoryIntegrity or SystemTweak.Hags or SystemTweak.WindowedOptimizations,
|
||||
ToggleCommand = new AsyncRelayCommand<SystemTweakItem>(this.ToggleTweakAsync),
|
||||
ActionCommand = new AsyncRelayCommand<SystemTweakItem>(this.OpenTweakSettingsAsync),
|
||||
}));
|
||||
this.ApplyLocalizedTweakText();
|
||||
}
|
||||
@@ -105,8 +107,20 @@ namespace ThreadPilot.ViewModels
|
||||
{
|
||||
TweakStatus status = item.TweakType switch
|
||||
{
|
||||
SystemTweak.GameMode => await this.systemTweaksService.GetGameModeStatusAsync(),
|
||||
SystemTweak.CoreParking => await this.systemTweaksService.GetCoreParkingStatusAsync(),
|
||||
SystemTweak.CStates => await this.systemTweaksService.GetCStatesStatusAsync(),
|
||||
SystemTweak.MemoryIntegrity => await this.systemTweaksService.GetMemoryIntegrityStatusAsync(),
|
||||
SystemTweak.Hags or SystemTweak.WindowedOptimizations => new TweakStatus
|
||||
{
|
||||
IsAvailable = true,
|
||||
StatusText = this.Localize("SystemTweaks_StatusManagedByWindows", "Managed by Windows"),
|
||||
},
|
||||
SystemTweak.UsbSelectiveSuspend => await this.systemTweaksService.GetUsbSelectiveSuspendStatusAsync(),
|
||||
SystemTweak.PointerPrecision => await this.systemTweaksService.GetPointerPrecisionStatusAsync(),
|
||||
SystemTweak.EthernetPowerSaving => await this.systemTweaksService.GetEthernetPowerSavingStatusAsync(),
|
||||
SystemTweak.InterruptModeration => await this.systemTweaksService.GetInterruptModerationStatusAsync(),
|
||||
SystemTweak.GpuMsiMode => await this.systemTweaksService.GetGpuMsiModeStatusAsync(),
|
||||
SystemTweak.SysMain => await this.systemTweaksService.GetSysMainStatusAsync(),
|
||||
SystemTweak.Prefetch => await this.systemTweaksService.GetPrefetchStatusAsync(),
|
||||
SystemTweak.PowerThrottling => await this.systemTweaksService.GetPowerThrottlingStatusAsync(),
|
||||
@@ -118,6 +132,7 @@ namespace ThreadPilot.ViewModels
|
||||
item.IsEnabled = status.IsEnabled;
|
||||
item.IsAvailable = status.IsAvailable;
|
||||
item.ErrorMessage = status.ErrorMessage;
|
||||
item.StatusText = status.StatusText ?? this.GetStatusText(status);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -144,8 +159,14 @@ namespace ThreadPilot.ViewModels
|
||||
var newState = !item.IsEnabled;
|
||||
bool success = item.TweakType switch
|
||||
{
|
||||
SystemTweak.GameMode => await this.systemTweaksService.SetGameModeAsync(newState),
|
||||
SystemTweak.CoreParking => await this.systemTweaksService.SetCoreParkingAsync(newState),
|
||||
SystemTweak.CStates => await this.systemTweaksService.SetCStatesAsync(newState),
|
||||
SystemTweak.UsbSelectiveSuspend => await this.systemTweaksService.SetUsbSelectiveSuspendAsync(newState),
|
||||
SystemTweak.PointerPrecision => await this.systemTweaksService.SetPointerPrecisionAsync(newState),
|
||||
SystemTweak.EthernetPowerSaving => await this.systemTweaksService.SetEthernetPowerSavingAsync(newState),
|
||||
SystemTweak.InterruptModeration => await this.systemTweaksService.SetInterruptModerationAsync(newState),
|
||||
SystemTweak.GpuMsiMode => await this.systemTweaksService.SetGpuMsiModeAsync(newState),
|
||||
SystemTweak.SysMain => await this.systemTweaksService.SetSysMainAsync(newState),
|
||||
SystemTweak.Prefetch => await this.systemTweaksService.SetPrefetchAsync(newState),
|
||||
SystemTweak.PowerThrottling => await this.systemTweaksService.SetPowerThrottlingAsync(newState),
|
||||
@@ -209,6 +230,18 @@ namespace ThreadPilot.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OpenTweakSettingsAsync(SystemTweakItem? item)
|
||||
{
|
||||
if (item == null || !await this.systemTweaksService.OpenSettingsAsync(item.TweakType))
|
||||
{
|
||||
this.SetError(this.Localize("SystemTweaks_StatusOpenSettingsFailed", "Could not open Windows settings"), null);
|
||||
return;
|
||||
}
|
||||
|
||||
this.SetStatus(this.Localize("SystemTweaks_StatusSettingsOpenedFormat", "Opened settings for {0}", item.Name));
|
||||
await this.LogUserActionAsync("SystemTweakSettingsOpened", $"Opened settings for {item.Name}", item.TweakType.ToString());
|
||||
}
|
||||
|
||||
private static Task InvokeOnUiAsync(Action action)
|
||||
{
|
||||
var dispatcher = System.Windows.Application.Current?.Dispatcher;
|
||||
@@ -227,8 +260,17 @@ namespace ThreadPilot.ViewModels
|
||||
{
|
||||
var text = item.TweakType switch
|
||||
{
|
||||
SystemTweak.GameMode => ("SystemTweak_GameMode_Name", "Game Mode", "SystemTweak_GameMode_Desc", "Windows Game Mode scheduling optimizations"),
|
||||
SystemTweak.CoreParking => ("SystemTweak_CoreParking_Name", "Core Parking", "SystemTweak_CoreParking_Desc", "Controls CPU core parking for power management"),
|
||||
SystemTweak.CStates => ("SystemTweak_CStates_Name", "C-States", "SystemTweak_CStates_Desc", "Controls CPU C-States for power management"),
|
||||
SystemTweak.MemoryIntegrity => ("SystemTweak_MemoryIntegrity_Name", "Memory Integrity (HVCI)", "SystemTweak_MemoryIntegrity_Desc", "Opens Windows Security. Disabling this protection reduces system security and may require a restart."),
|
||||
SystemTweak.Hags => ("SystemTweak_Hags_Name", "Hardware-accelerated GPU scheduling", "SystemTweak_Hags_Desc", "Opens Windows graphics settings to let you review HAGS."),
|
||||
SystemTweak.WindowedOptimizations => ("SystemTweak_WindowedOptimizations_Name", "Optimizations for windowed games", "SystemTweak_WindowedOptimizations_Desc", "Opens Windows graphics settings to manage Flip Model optimizations."),
|
||||
SystemTweak.UsbSelectiveSuspend => ("SystemTweak_UsbSelectiveSuspend_Name", "USB Selective Suspend", "SystemTweak_UsbSelectiveSuspend_Desc", "Controls USB selective suspend for the active power plan while plugged in."),
|
||||
SystemTweak.PointerPrecision => ("SystemTweak_PointerPrecision_Name", "Enhance pointer precision", "SystemTweak_PointerPrecision_Desc", "Controls Windows mouse acceleration."),
|
||||
SystemTweak.EthernetPowerSaving => ("SystemTweak_EthernetPowerSaving_Name", "Disable Ethernet power saving", "SystemTweak_EthernetPowerSaving_Desc", "Disables supported EEE, Green Ethernet and power-saving driver properties on physical Ethernet adapters."),
|
||||
SystemTweak.InterruptModeration => ("SystemTweak_InterruptModeration_Name", "Disable interrupt moderation", "SystemTweak_InterruptModeration_Desc", "Can reduce Ethernet latency at the cost of higher CPU and interrupt load."),
|
||||
SystemTweak.GpuMsiMode => ("SystemTweak_GpuMsiMode_Name", "GPU MSI Mode", "SystemTweak_GpuMsiMode_Desc", "Controls MSI only when the display driver already exposes MSISupported. A restart is required."),
|
||||
SystemTweak.SysMain => ("SystemTweak_SysMain_Name", "SysMain Service", "SystemTweak_SysMain_Desc", "Windows SysMain service for memory management"),
|
||||
SystemTweak.Prefetch => ("SystemTweak_Prefetch_Name", "Prefetch", "SystemTweak_Prefetch_Desc", "Windows Prefetch for faster application loading"),
|
||||
SystemTweak.PowerThrottling => ("SystemTweak_PowerThrottling_Name", "Power Throttling", "SystemTweak_PowerThrottling_Desc", "Turns off Windows Power Throttling for sustained performance"),
|
||||
@@ -239,6 +281,10 @@ namespace ThreadPilot.ViewModels
|
||||
|
||||
item.Name = this.Localize(text.Item1, text.Item2);
|
||||
item.Description = this.Localize(text.Item3, text.Item4);
|
||||
if (!string.IsNullOrEmpty(item.StatusText) && item.TweakType is not SystemTweak.Hags and not SystemTweak.WindowedOptimizations)
|
||||
{
|
||||
item.StatusText = this.GetStatusText(new TweakStatus { IsAvailable = item.IsAvailable, IsEnabled = item.IsEnabled });
|
||||
}
|
||||
}
|
||||
|
||||
this.RefreshStatusText = this.Localize("SystemTweaks_StatusReady", "Ready");
|
||||
@@ -255,6 +301,10 @@ namespace ThreadPilot.ViewModels
|
||||
: string.Format(CultureInfo.CurrentCulture, format, arguments);
|
||||
}
|
||||
|
||||
private string GetStatusText(TweakStatus status) => !status.IsAvailable
|
||||
? this.Localize("SystemTweaks_StatusNotAvailable", "Not available")
|
||||
: this.Localize(status.IsEnabled ? "SystemTweaks_StatusEnabled" : "SystemTweaks_StatusDisabled", status.IsEnabled ? "Enabled" : "Disabled");
|
||||
|
||||
private void OnLanguageChanged(object? sender, string language) => this.ApplyLocalizedTweakText();
|
||||
|
||||
private void OnTweakStatusChanged(object? sender, TweakStatusChangedEventArgs e)
|
||||
@@ -267,6 +317,7 @@ namespace ThreadPilot.ViewModels
|
||||
item.IsEnabled = e.Status.IsEnabled;
|
||||
item.IsAvailable = e.Status.IsAvailable;
|
||||
item.ErrorMessage = e.Status.ErrorMessage;
|
||||
item.StatusText = e.Status.StatusText ?? this.GetStatusText(e.Status);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -303,6 +354,14 @@ namespace ThreadPilot.ViewModels
|
||||
[ObservableProperty]
|
||||
private string? errorMessage;
|
||||
|
||||
[ObservableProperty]
|
||||
private string statusText = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isGuidedAction;
|
||||
|
||||
public IAsyncRelayCommand<SystemTweakItem>? ToggleCommand { get; set; }
|
||||
|
||||
public IAsyncRelayCommand<SystemTweakItem>? ActionCommand { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,26 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,16">
|
||||
<TextBlock Text="{DynamicResource PowerPlanView_Title}" Style="{StaticResource PageTitleTextStyle}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{DynamicResource PowerPlanView_Subtitle}" Style="{StaticResource PageSubtitleTextStyle}"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="0" Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{DynamicResource PowerPlanView_Title}" Style="{StaticResource PageTitleTextStyle}" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{DynamicResource PowerPlanView_Subtitle}" Style="{StaticResource PageSubtitleTextStyle}"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding OpenMorePlansCommand}"
|
||||
Padding="12,7"
|
||||
ToolTip="{DynamicResource PowerPlanView_MorePlansTooltip}"
|
||||
AutomationProperties.Name="{DynamicResource PowerPlanView_MorePlans}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="Chat32" Margin="0,0,7,0"/>
|
||||
<TextBlock Text="{DynamicResource PowerPlanView_MorePlans}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -305,6 +305,25 @@
|
||||
Command="{Binding ApplyAffinityAndSaveAsRuleCommand}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
||||
</MenuItem>
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_SetIoPriority}">
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_PriorityVeryLow}"
|
||||
Command="{Binding SetContextIoPriorityVeryLowCommand}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_PriorityLow}"
|
||||
Command="{Binding SetContextIoPriorityLowCommand}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_PriorityNormal}"
|
||||
Command="{Binding SetContextIoPriorityNormalCommand}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_PriorityHigh}"
|
||||
Command="{Binding SetContextIoPriorityHighCommand}"
|
||||
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
||||
</MenuItem>
|
||||
<Separator Style="{StaticResource ProcessContextMenuSeparatorStyle}"/>
|
||||
<MenuItem Style="{StaticResource ProcessContextMenuItemStyle}"
|
||||
Header="{DynamicResource ProcessView_SetCpuPriority}">
|
||||
@@ -460,6 +479,9 @@
|
||||
<TextBlock Text="{Binding SelectedProcessSummary.MemoryPriorityText}"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
Margin="0,0,18,4"/>
|
||||
<TextBlock Text="{Binding SelectedProcessSummary.IoPriorityText}"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
Margin="0,0,18,4"/>
|
||||
<TextBlock Text="{Binding SelectedProcessSummary.AffinityText}"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
Margin="0,0,18,4"/>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:local="clr-namespace:ThreadPilot.Views"
|
||||
xmlns:models="clr-namespace:ThreadPilot.Models"
|
||||
xmlns:converters="clr-namespace:ThreadPilot.Converters"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="600" d:DesignWidth="800">
|
||||
|
||||
@@ -379,6 +380,41 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Support Section -->
|
||||
<StackPanel Width="372" Margin="0,0,16,16">
|
||||
<TextBlock Text="{DynamicResource SettingsView_SomethingWrong}" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
||||
<Border Style="{StaticResource SettingsCardStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{DynamicResource SettingsView_DiscordDescription}" Style="{StaticResource DescriptionStyle}"/>
|
||||
<Button Command="{Binding OpenDiscordCommand}"
|
||||
Padding="12,6"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,8,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Viewbox Width="17" Height="17" Margin="0,0,7,0">
|
||||
<Path Fill="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Data="M20.317,4.37 C18.78,3.66 17.13,3.15 15.432,2.855 C15.26,2.83 15.18,2.91 15.08,3.09 C14.87,3.47 14.64,3.96 14.47,4.34 C12.63,4.06 10.79,4.06 8.99,4.34 C8.82,3.95 8.58,3.47 8.37,3.09 C8.27,2.91 8.19,2.83 8.02,2.855 C6.32,3.15 4.67,3.66 3.13,4.37 C0.53,8.02 -0.32,13.58 0.1,18.06 C1.94,19.54 4.04,20.54 6.12,21.14 C6.61,20.47 7.05,19.76 7.42,19.02 C6.76,18.77 6.14,18.47 5.54,18.13 C5.79,17.94 6.04,17.75 6.28,17.55 C10.14,19.34 14.39,19.34 18.25,17.55 C18.49,17.75 18.74,17.94 18.99,18.13 C18.39,18.47 17.77,18.77 17.11,19.02 C17.48,19.76 17.92,20.47 18.41,21.14 C20.49,20.54 22.59,19.54 24.43,18.06 C24.93,12.88 23.59,8.39 20.32,4.37 Z M8.02,15.33 C6.84,15.33 5.86,14.25 5.86,12.91 C5.86,11.58 6.82,10.49 8.02,10.49 C9.23,10.49 10.19,11.59 10.18,12.91 C10.18,14.25 9.22,15.33 8.02,15.33 Z M15.99,15.33 C14.81,15.33 13.84,14.25 13.84,12.91 C13.84,11.58 14.79,10.49 15.99,10.49 C17.2,10.49 18.17,11.59 18.15,12.91 C18.15,14.25 17.21,15.33 15.99,15.33 Z"/>
|
||||
</Viewbox>
|
||||
<TextBlock Text="{DynamicResource SettingsView_OpenDiscord}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Separator Margin="0,12"/>
|
||||
|
||||
<TextBlock Text="{DynamicResource SettingsView_IssuesDescription}" Style="{StaticResource DescriptionStyle}"/>
|
||||
<Button Command="{Binding ReportIssueCommand}"
|
||||
Padding="12,6"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,8,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="Bug24" Margin="0,0,7,0"/>
|
||||
<TextBlock Text="{DynamicResource SettingsView_ReportIssue}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- About Section -->
|
||||
<StackPanel Width="372" Margin="0,0,16,16">
|
||||
<TextBlock Text="{DynamicResource SettingsView_About}" Style="{StaticResource SectionHeaderStyle}" Margin="0,0,0,8"/>
|
||||
|
||||
+34
-17
@@ -127,23 +127,10 @@
|
||||
</Ellipse.Style>
|
||||
</Ellipse>
|
||||
|
||||
<TextBlock FontSize="11"
|
||||
<TextBlock Text="{Binding StatusText}"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextSecondaryBrush}"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Text" Value="{DynamicResource SystemTweaks_StatusEnabled}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
|
||||
<Setter Property="Text" Value="{DynamicResource SystemTweaks_StatusNotAvailable}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
|
||||
<Setter Property="Text" Value="{DynamicResource SystemTweaks_StatusDisabled}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<ui:ToggleSwitch Grid.Column="1"
|
||||
@@ -155,7 +142,37 @@
|
||||
HorizontalAlignment="Right"
|
||||
Margin="10,0,0,0"
|
||||
AutomationProperties.Name="{Binding Name}"
|
||||
ToolTip="{DynamicResource SystemTweaksView_TweakTooltip}"/>
|
||||
ToolTip="{DynamicResource SystemTweaksView_TweakTooltip}">
|
||||
<ui:ToggleSwitch.Style>
|
||||
<Style TargetType="ui:ToggleSwitch">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsGuidedAction}" Value="True">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ui:ToggleSwitch.Style>
|
||||
</ui:ToggleSwitch>
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Content="{DynamicResource SystemTweaks_OpenSettings}"
|
||||
Command="{Binding ActionCommand}"
|
||||
CommandParameter="{Binding}"
|
||||
IsEnabled="{Binding IsAvailable}"
|
||||
Padding="10,4"
|
||||
AutomationProperties.Name="{Binding Name}">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsGuidedAction}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMessage}"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.6.0.0" name="ThreadPilot.app"/>
|
||||
<assemblyIdentity version="1.7.0.0" name="ThreadPilot.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user