/// <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; }
private void Revert() { if (disposed) { return; } lock (hObj) { RuntimeHelpers.PrepareConstrainedRegions(); hObj.AdjustPrivileges(prev); } hObj.Dispose(); disposed = true; }
public void Dispose() { AdjustTokenPrivileges(tok, false, prevState); prevState.Dispose(); tok.Dispose(); }