48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
/* 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<BaseWindowInfo>? _windows;
|
|
|
|
[JsonIgnore]
|
|
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
|
|
{
|
|
get => MemoryRegionsContainer.Values;
|
|
}
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public IEnumerable<ProcessModuleInfo>? Modules
|
|
{
|
|
get => ModulesContainer.Values;
|
|
}
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public IEnumerable<ProcessThreadInfo>? Threads
|
|
{
|
|
get => ThreadsContainer.Values;
|
|
}
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
|
public IEnumerable<BaseWindowInfo>? Windows
|
|
{
|
|
get => LockedGet(ref _windows);
|
|
internal set => LockedSet(ref _windows, value);
|
|
}
|
|
}
|
|
}
|