| File: Generated\361d1da7f942c932\Microsoft_Diagnostics_DataContractReader_Data.ProfControlBlock.g.cs | |
| Project: Microsoft.Diagnostics.DataContractReader.Contracts.csproj (Microsoft.Diagnostics.DataContractReader.Contracts) |
// <auto-generated/> #nullable enable using Microsoft.Diagnostics.DataContractReader; using Microsoft.Diagnostics.DataContractReader.Contracts; using Microsoft.Diagnostics.DataContractReader.Generated; namespace Microsoft.Diagnostics.DataContractReader.Data; /// <summary>Wraps the <c>ProfControlBlock</c> type.</summary> partial class ProfControlBlock { private static readonly string[] _typeNames = new[] { "ProfControlBlock" }; [UsesDataDescriptorTypeSize] public static uint GetSize(Target target) => checked((uint)TypeLayout.Resolve(target, _typeNames).InstanceSize); [DataDescriptorDependency("GlobalEventMask", "uint64")] public static int GetGlobalEventMaskOffset(Target target) { TypeLayout layout = TypeLayout.Resolve(target, _typeNames); layout.Select(default, out var type, out _, out var name, "GlobalEventMask"); return type.Fields[name].Offset; } [DataDescriptorDependency("RejitOnAttachEnabled", "uint8")] public static int GetRejitOnAttachEnabledOffset(Target target) { TypeLayout layout = TypeLayout.Resolve(target, _typeNames); layout.Select(default, out var type, out _, out var name, "RejitOnAttachEnabled"); return type.Fields[name].Offset; } [DataDescriptorDependency("MainProfilerProfInterface", "pointer")] public static int GetMainProfilerProfInterfaceOffset(Target target) { TypeLayout layout = TypeLayout.Resolve(target, _typeNames); layout.Select(default, out var type, out _, out var name, "MainProfilerProfInterface"); return type.Fields[name].Offset; } [DataDescriptorDependency("NotificationProfilerCount", "int32")] public static int GetNotificationProfilerCountOffset(Target target) { TypeLayout layout = TypeLayout.Resolve(target, _typeNames); layout.Select(default, out var type, out _, out var name, "NotificationProfilerCount"); return type.Fields[name].Offset; } public TargetPointer Address { get; } private readonly Target _target; private readonly TypeLayout _layout; public ProfControlBlock(Target target, TargetPointer address) { Address = address; _target = target; _layout = TypeLayout.Resolve(target, _typeNames); } static ProfControlBlock IData<ProfControlBlock>.Create(Target target, TargetPointer address) => new ProfControlBlock(target, address); private ulong _GlobalEventMask__value = default!; private bool _GlobalEventMask__read; [DataDescriptorDependency("GlobalEventMask", "uint64")] public partial ulong GlobalEventMask { get { if (!_GlobalEventMask__read) { _layout.Select(Address, out var t, out var b, out var n, "GlobalEventMask"); _GlobalEventMask__value = _target.ReadField<ulong>(b, t, n); _GlobalEventMask__read = true; } return _GlobalEventMask__value; } } private bool _RejitOnAttachEnabled__value = default!; private bool _RejitOnAttachEnabled__read; [DataDescriptorDependency("RejitOnAttachEnabled", "uint8")] public partial bool RejitOnAttachEnabled { get { if (!_RejitOnAttachEnabled__read) { _layout.Select(Address, out var t, out var b, out var n, "RejitOnAttachEnabled"); _RejitOnAttachEnabled__value = _target.ReadField<byte>(b, t, n) != 0; _RejitOnAttachEnabled__read = true; } return _RejitOnAttachEnabled__value; } } private TargetPointer _MainProfilerProfInterface__value = default!; private bool _MainProfilerProfInterface__read; [DataDescriptorDependency("MainProfilerProfInterface", "pointer")] public partial TargetPointer MainProfilerProfInterface { get { if (!_MainProfilerProfInterface__read) { _layout.Select(Address, out var t, out var b, out var n, "MainProfilerProfInterface"); _MainProfilerProfInterface__value = _target.ReadPointerField(b, t, n); _MainProfilerProfInterface__read = true; } return _MainProfilerProfInterface__value; } } private int _NotificationProfilerCount__value = default!; private bool _NotificationProfilerCount__read; [DataDescriptorDependency("NotificationProfilerCount", "int32")] public partial int NotificationProfilerCount { get { if (!_NotificationProfilerCount__read) { _layout.Select(Address, out var t, out var b, out var n, "NotificationProfilerCount"); _NotificationProfilerCount__value = _target.ReadField<int>(b, t, n); _NotificationProfilerCount__read = true; } return _NotificationProfilerCount__value; } } [DataDescriptorDependency("GlobalEventMask", "uint64")] [DataDescriptorDependency("RejitOnAttachEnabled", "uint8")] [DataDescriptorDependency("MainProfilerProfInterface", "pointer")] [DataDescriptorDependency("NotificationProfilerCount", "int32")] internal bool TryReadAllFields() { try { _ = GlobalEventMask; _ = RejitOnAttachEnabled; _ = MainProfilerProfInterface; _ = NotificationProfilerCount; return true; } catch (VirtualReadException) { return false; } } }