diff --git a/NSspi/Contexts/SafeContextHandle.cs b/NSspi/Contexts/SafeContextHandle.cs index 393056e..7fbddf7 100644 --- a/NSspi/Contexts/SafeContextHandle.cs +++ b/NSspi/Contexts/SafeContextHandle.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.ConstrainedExecution; using System.Text; using System.Threading.Tasks; @@ -13,6 +14,7 @@ namespace NSspi.Contexts : base() { } + [ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )] protected override bool ReleaseHandle() { SecurityStatus status = ContextNativeMethods.DeleteSecurityContext( diff --git a/NSspi/Credentials/SafeCredentialHandle.cs b/NSspi/Credentials/SafeCredentialHandle.cs index e6dfa93..2f6eaff 100644 --- a/NSspi/Credentials/SafeCredentialHandle.cs +++ b/NSspi/Credentials/SafeCredentialHandle.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.ConstrainedExecution; using System.Text; using System.Threading.Tasks; @@ -13,6 +14,7 @@ namespace NSspi.Credentials : base() { } + [ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )] protected override bool ReleaseHandle() { SecurityStatus status = CredentialNativeMethods.FreeCredentialsHandle(