Files
ThreadPilot/Services/ProcessOperationResult.cs
T
Prime Build 5f9f7b5409 Add process memory priority foundation (#15)
Add process memory priority foundation

Introduce backend support for process memory priority using Windows GetProcessInformation and SetProcessInformation while keeping the feature testable and safe.

- Add ProcessMemoryPriority model with documented Windows memory priority levels
- Add fakeable native API wrapper for process memory priority
- Add ProcessMemoryPriorityService with safe error handling
- Add ProcessOperationResult for process operation outcomes
- Extend persistent process rules with memory priority support
- Apply memory priority through PersistentRulesEngine when configured
- Preserve anti-cheat/protected-process safety messaging
- Add tests for native get/set, invalid process, access denied, unsupported API, enum mapping, persistent rules and JSON roundtrip

No UI redesign, registry/IFEO persistence, Windows Service, preset generator, migration, version or tag changes.
2026-05-20 21:45:21 +02:00

49 lines
1.4 KiB
C#

/*
* ThreadPilot - process operation result model.
*/
namespace ThreadPilot.Services
{
public sealed record ProcessOperationResult
{
public bool Success { get; init; }
public string ErrorCode { get; init; } = string.Empty;
public string UserMessage { get; init; } = string.Empty;
public string TechnicalMessage { get; init; } = string.Empty;
public bool IsAccessDenied { get; init; }
public bool IsAntiCheatLikely { get; init; }
public bool IsProcessExited { get; init; }
public static ProcessOperationResult Succeeded(string userMessage, string technicalMessage) =>
new()
{
Success = true,
UserMessage = userMessage,
TechnicalMessage = technicalMessage,
};
public static ProcessOperationResult Failed(
string errorCode,
string userMessage,
string technicalMessage,
bool isAccessDenied = false,
bool isAntiCheatLikely = false,
bool isProcessExited = false) =>
new()
{
Success = false,
ErrorCode = errorCode,
UserMessage = userMessage,
TechnicalMessage = technicalMessage,
IsAccessDenied = isAccessDenied,
IsAntiCheatLikely = isAntiCheatLikely,
IsProcessExited = isProcessExited,
};
}
}