25 lines
1.3 KiB
C#
25 lines
1.3 KiB
C#
using System;
|
|
using System.Runtime.ConstrainedExecution;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace NSspi
|
|
{
|
|
internal static class NativeMethods
|
|
{
|
|
[ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )]
|
|
[DllImport( "Secur32.dll", EntryPoint = "FreeContextBuffer", CharSet = CharSet.Unicode )]
|
|
internal static extern SecurityStatus FreeContextBuffer( IntPtr buffer );
|
|
|
|
[ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )]
|
|
[DllImport( "Secur32.dll", EntryPoint = "QuerySecurityPackageInfo", CharSet = CharSet.Unicode )]
|
|
internal static extern SecurityStatus QuerySecurityPackageInfo( string packageName, ref IntPtr pkgInfo );
|
|
|
|
[ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )]
|
|
[DllImport( "Secur32.dll", EntryPoint = "EnumerateSecurityPackages", CharSet = CharSet.Unicode )]
|
|
internal static extern SecurityStatus EnumerateSecurityPackages( ref int numPackages, ref IntPtr pkgInfoArry );
|
|
|
|
[DllImport( "Kernel32.dll", EntryPoint = "CloseHandle", SetLastError = true )]
|
|
[ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )]
|
|
internal static extern bool CloseHandle( IntPtr handle );
|
|
}
|
|
} |