/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
 public virtual void Dispose()
 {
     if (ownId)
     {
         AuthenticatedIdentity?.Dispose();
     }
     hToken?.Dispose();
     AuthenticatedIdentity = null;
 }
Beispiel #2
0
 private void Revert()
 {
     if (disposed)
     {
         return;
     }
     lock (hObj)
     {
         RuntimeHelpers.PrepareConstrainedRegions();
         hObj.AdjustPrivileges(prev);
     }
     hObj.Dispose();
     disposed = true;
 }
Beispiel #3
0
 public void Dispose()
 {
     AdjustTokenPrivileges(tok, false, prevState);
     prevState.Dispose();
     tok.Dispose();
 }