Пример #1
0
        public static Quotas Initialize(File file)
        {
            Index ownerIndex = file.CreateIndex("$O", (AttributeType)0, AttributeCollationRule.Sid);
            Index quotaIndox = file.CreateIndex("$Q", (AttributeType)0, AttributeCollationRule.UnsignedLong);

            IndexView <OwnerKey, OwnerRecord>    ownerIndexView = new IndexView <OwnerKey, OwnerRecord>(ownerIndex);
            IndexView <OwnerRecord, QuotaRecord> quotaIndexView = new IndexView <OwnerRecord, QuotaRecord>(quotaIndox);

            OwnerKey    adminSid     = new OwnerKey(new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null));
            OwnerRecord adminOwnerId = new OwnerRecord(256);

            ownerIndexView[adminSid] = adminOwnerId;

            quotaIndexView[new OwnerRecord(1)] = new QuotaRecord(null);
            quotaIndexView[adminOwnerId]       = new QuotaRecord(adminSid.Sid);

            return(new Quotas(file));
        }
Пример #2
0
        public static Quotas Initialize(File file)
        {
            Index ownerIndex = file.CreateIndex("$O", (AttributeType)0, AttributeCollationRule.Sid);
            Index quotaIndox = file.CreateIndex("$Q", (AttributeType)0, AttributeCollationRule.UnsignedLong);

            IndexView<OwnerKey, OwnerRecord> ownerIndexView = new IndexView<OwnerKey, OwnerRecord>(ownerIndex);
            IndexView<OwnerRecord, QuotaRecord> quotaIndexView = new IndexView<OwnerRecord, QuotaRecord>(quotaIndox);

            OwnerKey adminSid = new OwnerKey(new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null));
            OwnerRecord adminOwnerId = new OwnerRecord(256);

            ownerIndexView[adminSid] = adminOwnerId;

            quotaIndexView[new OwnerRecord(1)] = new QuotaRecord(null);
            quotaIndexView[adminOwnerId] = new QuotaRecord(adminSid.Sid);

            return new Quotas(file);
        }