diff --git a/Contexts/ContextNativeMethods.cs b/Contexts/ContextNativeMethods.cs index 6ddcf6c..bff36a9 100644 --- a/Contexts/ContextNativeMethods.cs +++ b/Contexts/ContextNativeMethods.cs @@ -146,6 +146,16 @@ namespace NSspi.Contexts [DllImport( "Secur32.dll", EntryPoint = "FreeContextBuffer", CharSet = CharSet.Unicode )] internal static extern SecurityStatus FreeContextBuffer( IntPtr handle ); + + [ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )] + [DllImport( "Secur32.dll", EntryPoint = "ImpersonateSecurityContext ", CharSet = CharSet.Unicode )] + internal static extern SecurityStatus ImpersonateSecurityContext( ref RawSspiHandle contextHandle ); + + [ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )] + [DllImport( "Secur32.dll", EntryPoint = "RevertSecurityContext ", CharSet = CharSet.Unicode )] + internal static extern SecurityStatus RevertSecurityContext( ref RawSspiHandle contextHandle ); + + internal static SecurityStatus SafeEncryptMessage( SafeContextHandle handle, int qualityOfProtection, diff --git a/NSspi.csproj b/NSspi.csproj index 45db057..10cd6c5 100644 --- a/NSspi.csproj +++ b/NSspi.csproj @@ -53,6 +53,7 @@ +