Moved the safe handles for credentials and contexts into their own file.

This commit is contained in:
antiduh
2014-06-24 20:21:09 +00:00
parent 508cd9df49
commit 970c0f2bfa
4 changed files with 57 additions and 36 deletions

View File

@@ -66,40 +66,4 @@ namespace NSspi
return true;
}
}
public class SafeCredentialHandle : SafeSspiHandle
{
public SafeCredentialHandle()
: base()
{ }
protected override bool ReleaseHandle()
{
SecurityStatus status = CredentialNativeMethods.FreeCredentialsHandle(
ref base.rawHandle
);
base.ReleaseHandle();
return status == SecurityStatus.OK;
}
}
public class SafeContextHandle : SafeSspiHandle
{
public SafeContextHandle()
: base()
{ }
protected override bool ReleaseHandle()
{
SecurityStatus status = ContextNativeMethods.DeleteSecurityContext(
ref base.rawHandle
);
base.ReleaseHandle();
return status == SecurityStatus.OK;
}
}
}