public void Dispose()
        {
#if NETSTANDARD || NETCOREAPP
            NativeMethods.RevertToSelf();
#else
            if (impersonationContext != null)
            {
                impersonationContext.Undo();
            }
#endif
            token?.Dispose();
            if (identity != null)
            {
                identity.Dispose();
            }
        }