public override IEnumerable <NtType> CreateTypes()
 {
     return(new NtType[] {
         new NtType(LsaPolicyUtils.LSA_POLICY_NT_TYPE_NAME, LsaPolicyUtils.GetLsaPolicyGenericMapping(),
                    typeof(LsaPolicyAccessRights), typeof(LsaPolicyAccessRights),
                    MandatoryLabelPolicy.NoWriteUp),
         new NtType(LsaPolicyUtils.LSA_SECRET_NT_TYPE_NAME, LsaPolicyUtils.GetLsaSecretGenericMapping(),
                    typeof(LsaSecretAccessRights), typeof(LsaSecretAccessRights),
                    MandatoryLabelPolicy.NoWriteUp),
         new NtType(LsaPolicyUtils.LSA_ACCOUNT_NT_TYPE_NAME, LsaPolicyUtils.GetLsaAccountGenericMapping(),
                    typeof(LsaAccountAccessRights), typeof(LsaAccountAccessRights),
                    MandatoryLabelPolicy.NoWriteUp),
         new NtType(LsaPolicyUtils.LSA_TRUSTED_DOMAIN_NT_TYPE_NAME, LsaPolicyUtils.GetLsaTrustedDomainGenericMapping(),
                    typeof(LsaTrustedDomainAccessRights), typeof(LsaTrustedDomainAccessRights),
                    MandatoryLabelPolicy.NoWriteUp)
     });
 }
 /// <summary>
 /// Enumerate trusted domain information.
 /// </summary>
 /// <param name="throw_on_error">True to throw on error.</param>
 /// <returns>The list of trusted domain information.</returns>
 public NtResult <IReadOnlyList <LsaTrustedDomainInformation> > EnumerateTrustedDomains(bool throw_on_error)
 {
     return(LsaPolicyUtils.LsaEnumerateObjects(Handle, SecurityNativeMethods.LsaEnumerateTrustedDomainsEx,
                                               (TRUSTED_DOMAIN_INFORMATION_EX s) => new LsaTrustedDomainInformation(s), throw_on_error));
 }
 /// <summary>
 /// Enumerate account SIDs in policy.
 /// </summary>
 /// <param name="throw_on_error">True to throw on error.</param>
 /// <returns>The list of account SIDs.</returns>
 public NtResult <IReadOnlyList <Sid> > EnumerateAccounts(bool throw_on_error)
 {
     return(LsaPolicyUtils.LsaEnumerateObjects(Handle, SecurityNativeMethods.LsaEnumerateAccounts,
                                               (LSAPR_ACCOUNT_INFORMATION s) => new Sid(s.Sid), throw_on_error));
 }