Implemented safe access to the safeCredHandle when reading credential name.

This commit is contained in:
antiduh
2014-06-24 22:34:44 +00:00
parent 28a3835060
commit 4f98c9467e
3 changed files with 43 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
@@ -63,6 +64,7 @@ namespace NSspi
/// <param name="attributeName"></param>
/// <param name="name"></param>
/// <returns></returns>
[ReliabilityContract( Consistency.WillNotCorruptState, Cer.Success )]
[DllImport( "Secur32.dll", EntryPoint = "QueryCredentialsAttributes", CharSet = CharSet.Unicode )]
public static extern SecurityStatus QueryCredentialsAttribute_Name(
ref RawSspiHandle credentialHandle,