2025-07-04 00:04:51 +03:00
|
|
|
|
/* This software is licensed by the MIT License, see LICENSE file */
|
|
|
|
|
/* Copyright <20> 2024-2025 Gregory Lirent */
|
2025-07-02 16:06:50 +03:00
|
|
|
|
|
|
|
|
|
using System.Runtime.Versioning;
|
|
|
|
|
using System.Text.Json.Serialization;
|
2025-07-03 15:22:40 +03:00
|
|
|
|
using WebmrAPI.Utils;
|
2025-06-30 18:15:07 +03:00
|
|
|
|
|
|
|
|
|
namespace WebmrAPI.Models
|
|
|
|
|
{
|
2025-07-02 16:06:50 +03:00
|
|
|
|
[SupportedOSPlatform("windows")]
|
|
|
|
|
public class ProcessInfo : ProcessBaseInfo
|
2025-06-30 18:15:07 +03:00
|
|
|
|
{
|
2025-07-13 14:24:51 +03:00
|
|
|
|
private IEnumerable<BaseWindowInfo>? _windows;
|
|
|
|
|
|
2025-07-02 16:06:50 +03:00
|
|
|
|
[JsonIgnore]
|
2025-07-03 15:22:40 +03:00
|
|
|
|
public LazyConcurrentContainer<MemoryRegionInfo> MemoryRegionsContainer { get; set; } = new();
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public LazyConcurrentContainer<ProcessModuleInfo> ModulesContainer { get; set; } = new();
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public LazyConcurrentContainer<ProcessThreadInfo> ThreadsContainer { get; set; } = new();
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
|
|
|
public IEnumerable<MemoryRegionInfo>? MemoryRegions
|
2025-07-02 16:06:50 +03:00
|
|
|
|
{
|
2025-07-03 15:22:40 +03:00
|
|
|
|
get => MemoryRegionsContainer.Values;
|
2025-07-02 16:06:50 +03:00
|
|
|
|
}
|
2025-07-03 15:22:40 +03:00
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
|
|
|
public IEnumerable<ProcessModuleInfo>? Modules
|
|
|
|
|
{
|
|
|
|
|
get => ModulesContainer.Values;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
|
|
|
public IEnumerable<ProcessThreadInfo>? Threads
|
2025-07-02 16:06:50 +03:00
|
|
|
|
{
|
2025-07-03 15:22:40 +03:00
|
|
|
|
get => ThreadsContainer.Values;
|
2025-07-02 16:06:50 +03:00
|
|
|
|
}
|
2025-07-13 14:24:51 +03:00
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
|
|
|
public IEnumerable<BaseWindowInfo>? Windows
|
|
|
|
|
{
|
|
|
|
|
get => LockedGet(ref _windows);
|
|
|
|
|
internal set => LockedSet(ref _windows, value);
|
|
|
|
|
}
|
2025-06-30 18:15:07 +03:00
|
|
|
|
}
|
2025-07-02 16:06:50 +03:00
|
|
|
|
}
|