mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
[LSASRV]
- Set the default quota limits when the LSA database is created. - Implement the PolicyDefaultQuotaInformation class of LsarQueryInformationPolicy. svn path=/trunk/; revision=57383
This commit is contained in:
parent
c108d80dee
commit
580872f32d
4 changed files with 56 additions and 1 deletions
|
@ -226,10 +226,19 @@ LsapCreateRandomDomainSid(OUT PSID *Sid)
|
|||
static NTSTATUS
|
||||
LsapCreateDatabaseObjects(VOID)
|
||||
{
|
||||
POLICY_DEFAULT_QUOTA_INFO QuotaInfo;
|
||||
PLSA_DB_OBJECT PolicyObject = NULL;
|
||||
PSID AccountDomainSid = NULL;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Initialize the default quota limits */
|
||||
QuotaInfo.QuotaLimits.PagedPoolLimit = 0x2000000;
|
||||
QuotaInfo.QuotaLimits.NonPagedPoolLimit = 0x100000;
|
||||
QuotaInfo.QuotaLimits.MinimumWorkingSetSize = 0x10000;
|
||||
QuotaInfo.QuotaLimits.MaximumWorkingSetSize = 0xF000000;
|
||||
QuotaInfo.QuotaLimits.PagefileLimit = 0;
|
||||
QuotaInfo.QuotaLimits.TimeLimit.QuadPart = 0;
|
||||
|
||||
/* Create a random domain SID */
|
||||
Status = LsapCreateRandomDomainSid(&AccountDomainSid);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -264,6 +273,12 @@ LsapCreateDatabaseObjects(VOID)
|
|||
AccountDomainSid,
|
||||
RtlLengthSid(AccountDomainSid));
|
||||
|
||||
/* Set the default quota limits attribute */
|
||||
LsapSetObjectAttribute(PolicyObject,
|
||||
L"DefQuota",
|
||||
&QuotaInfo,
|
||||
sizeof(POLICY_DEFAULT_QUOTA_INFO));
|
||||
|
||||
done:
|
||||
if (PolicyObject != NULL)
|
||||
LsapCloseDbObject(PolicyObject);
|
||||
|
|
|
@ -248,6 +248,11 @@ NTSTATUS WINAPI LsarQueryInformationPolicy(
|
|||
PolicyInformation);
|
||||
break;
|
||||
|
||||
case PolicyDefaultQuotaInformation: /* 8 */
|
||||
Status = LsarQueryDefaultQuota(PolicyHandle,
|
||||
PolicyInformation);
|
||||
break;
|
||||
|
||||
case PolicyDnsDomainInformation: /* 12 (0xc) */
|
||||
Status = LsarQueryDnsDomain(PolicyHandle,
|
||||
PolicyInformation);
|
||||
|
@ -257,7 +262,6 @@ NTSTATUS WINAPI LsarQueryInformationPolicy(
|
|||
case PolicyPdAccountInformation:
|
||||
case PolicyLsaServerRoleInformation:
|
||||
case PolicyReplicaSourceInformation:
|
||||
case PolicyDefaultQuotaInformation:
|
||||
case PolicyModificationInformation:
|
||||
case PolicyAuditFullSetInformation:
|
||||
case PolicyAuditFullQueryInformation:
|
||||
|
|
|
@ -113,6 +113,10 @@ NTSTATUS
|
|||
LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject,
|
||||
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
||||
|
||||
NTSTATUS
|
||||
LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject,
|
||||
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
||||
|
||||
NTSTATUS
|
||||
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
||||
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
||||
|
|
|
@ -357,6 +357,38 @@ Done:
|
|||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject,
|
||||
PLSAPR_POLICY_INFORMATION *PolicyInformation)
|
||||
{
|
||||
PPOLICY_DEFAULT_QUOTA_INFO QuotaInfo = NULL;
|
||||
ULONG AttributeSize;
|
||||
NTSTATUS Status;
|
||||
|
||||
*PolicyInformation = NULL;
|
||||
|
||||
AttributeSize = sizeof(POLICY_DEFAULT_QUOTA_INFO);
|
||||
QuotaInfo = MIDL_user_allocate(AttributeSize);
|
||||
if (QuotaInfo == NULL)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
Status = LsapGetObjectAttribute(PolicyObject,
|
||||
L"DefQuota",
|
||||
QuotaInfo,
|
||||
&AttributeSize);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
MIDL_user_free(QuotaInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
*PolicyInformation = (PLSAPR_POLICY_INFORMATION)QuotaInfo;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
||||
PLSAPR_POLICY_INFORMATION *PolicyInformation)
|
||||
|
|
Loading…
Reference in a new issue