/* This software is licensed by the MIT License, see LICENSE file */ /* Copyright © 2024-2025 Gregory Lirent */ using System.Runtime.Versioning; using System.Text.Json.Serialization; using WebmrAPI.Utils; namespace WebmrAPI.Models { [SupportedOSPlatform("windows")] public class ProcessInfo : ProcessBaseInfo { private IEnumerable? _windows; [JsonIgnore] public LazyConcurrentContainer MemoryRegionsContainer { get; set; } = new(); [JsonIgnore] public LazyConcurrentContainer ModulesContainer { get; set; } = new(); [JsonIgnore] public LazyConcurrentContainer ThreadsContainer { get; set; } = new(); [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public IEnumerable? MemoryRegions { get => MemoryRegionsContainer.Values; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public IEnumerable? Modules { get => ModulesContainer.Values; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public IEnumerable? Threads { get => ThreadsContainer.Values; } [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public IEnumerable? Windows { get => LockedGet(ref _windows); internal set => LockedSet(ref _windows, value); } } }