From a681cc27c592a35a41172e269395733e2952e665 Mon Sep 17 00:00:00 2001 From: antiduh Date: Tue, 24 Jun 2014 17:41:35 +0000 Subject: [PATCH] Changed the SafeSspiHandle et al to invalidate the underlying handle after releasing it. --- SspiHandle.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SspiHandle.cs b/SspiHandle.cs index ed5601a..7d5ebef 100644 --- a/SspiHandle.cs +++ b/SspiHandle.cs @@ -58,6 +58,12 @@ namespace NSspi { get { return IsClosed || this.rawHandle.IsZero(); } } + + protected override bool ReleaseHandle() + { + this.rawHandle.SetInvalid(); + return true; + } } public class SafeCredentialHandle : SafeSspiHandle @@ -72,8 +78,9 @@ namespace NSspi ref base.rawHandle ); + base.ReleaseHandle(); + return status == SecurityStatus.OK; } } - }