private UserToken CreateRestrictedToken() { RestrictedTokenFlags flags = RestrictedTokenFlags.None; if (checkBoxDisableMaxPrivs.Checked) { flags |= RestrictedTokenFlags.DisableMaxPrivilege; } if (checkBoxMakeLuaToken.Checked) { flags |= RestrictedTokenFlags.LuaToken; } if (checkBoxSandboxInert.Checked) { flags |= RestrictedTokenFlags.SandboxInert; } if (checkBoxWriteRestricted.Checked) { flags |= RestrictedTokenFlags.WriteRestricted; } return(_token.CreateRestrictedToken(GetGroupFromList(listViewDisableSids.CheckedItems.OfType <ListViewItem>()), GetPrivileges(), GetGroupFromList(listViewRestrictedSids.Items.OfType <ListViewItem>()), flags)); }