From b96609716871e21886e6a75d1990d1a859620d84 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 23 Mar 2016 13:23:13 -0700 Subject: [PATCH] Use explicit field behind NTSTATUS.Value property Avoid using auto properties in structs used in P/Invoke signatures to workaround a bug in the .NET Native toolchain. Fixes #227 --- src/Windows.Core/NTStatus.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Windows.Core/NTStatus.cs b/src/Windows.Core/NTStatus.cs index faf6ad8e..3e177ec6 100644 --- a/src/Windows.Core/NTStatus.cs +++ b/src/Windows.Core/NTStatus.cs @@ -80,6 +80,11 @@ public partial struct NTSTATUS : IComparable, IComparable, IEquatable< /// private const int FacilityStatusShift = 0; + /// + /// The full NT_STATUS value, as a enum. + /// + private readonly Code value; + /// /// Initializes a new instance of the struct. /// @@ -104,13 +109,13 @@ public NTSTATUS(int status) /// The value of the NTStatus. public NTSTATUS(Code status) { - this.Value = status; + this.value = status; } /// /// Gets the full NT_STATUS value, as a enum. /// - public Code Value { get; } + public Code Value => this.value; /// /// Gets the NT_STATUS as a 32-bit signed integer.