Moved the safe handles for credentials and contexts into their own file.
This commit is contained in:
28
Credentials/SafeCredentialHandle.cs
Normal file
28
Credentials/SafeCredentialHandle.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NSspi.Credentials
|
||||
{
|
||||
|
||||
public class SafeCredentialHandle : SafeSspiHandle
|
||||
{
|
||||
public SafeCredentialHandle()
|
||||
: base()
|
||||
{ }
|
||||
|
||||
protected override bool ReleaseHandle()
|
||||
{
|
||||
SecurityStatus status = CredentialNativeMethods.FreeCredentialsHandle(
|
||||
ref base.rawHandle
|
||||
);
|
||||
|
||||
base.ReleaseHandle();
|
||||
|
||||
return status == SecurityStatus.OK;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user