mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 20:43:18 +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
|
static NTSTATUS
|
||||||
LsapCreateDatabaseObjects(VOID)
|
LsapCreateDatabaseObjects(VOID)
|
||||||
{
|
{
|
||||||
|
POLICY_DEFAULT_QUOTA_INFO QuotaInfo;
|
||||||
PLSA_DB_OBJECT PolicyObject = NULL;
|
PLSA_DB_OBJECT PolicyObject = NULL;
|
||||||
PSID AccountDomainSid = NULL;
|
PSID AccountDomainSid = NULL;
|
||||||
NTSTATUS Status;
|
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 */
|
/* Create a random domain SID */
|
||||||
Status = LsapCreateRandomDomainSid(&AccountDomainSid);
|
Status = LsapCreateRandomDomainSid(&AccountDomainSid);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -264,6 +273,12 @@ LsapCreateDatabaseObjects(VOID)
|
||||||
AccountDomainSid,
|
AccountDomainSid,
|
||||||
RtlLengthSid(AccountDomainSid));
|
RtlLengthSid(AccountDomainSid));
|
||||||
|
|
||||||
|
/* Set the default quota limits attribute */
|
||||||
|
LsapSetObjectAttribute(PolicyObject,
|
||||||
|
L"DefQuota",
|
||||||
|
&QuotaInfo,
|
||||||
|
sizeof(POLICY_DEFAULT_QUOTA_INFO));
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (PolicyObject != NULL)
|
if (PolicyObject != NULL)
|
||||||
LsapCloseDbObject(PolicyObject);
|
LsapCloseDbObject(PolicyObject);
|
||||||
|
|
|
@ -248,6 +248,11 @@ NTSTATUS WINAPI LsarQueryInformationPolicy(
|
||||||
PolicyInformation);
|
PolicyInformation);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PolicyDefaultQuotaInformation: /* 8 */
|
||||||
|
Status = LsarQueryDefaultQuota(PolicyHandle,
|
||||||
|
PolicyInformation);
|
||||||
|
break;
|
||||||
|
|
||||||
case PolicyDnsDomainInformation: /* 12 (0xc) */
|
case PolicyDnsDomainInformation: /* 12 (0xc) */
|
||||||
Status = LsarQueryDnsDomain(PolicyHandle,
|
Status = LsarQueryDnsDomain(PolicyHandle,
|
||||||
PolicyInformation);
|
PolicyInformation);
|
||||||
|
@ -257,7 +262,6 @@ NTSTATUS WINAPI LsarQueryInformationPolicy(
|
||||||
case PolicyPdAccountInformation:
|
case PolicyPdAccountInformation:
|
||||||
case PolicyLsaServerRoleInformation:
|
case PolicyLsaServerRoleInformation:
|
||||||
case PolicyReplicaSourceInformation:
|
case PolicyReplicaSourceInformation:
|
||||||
case PolicyDefaultQuotaInformation:
|
|
||||||
case PolicyModificationInformation:
|
case PolicyModificationInformation:
|
||||||
case PolicyAuditFullSetInformation:
|
case PolicyAuditFullSetInformation:
|
||||||
case PolicyAuditFullQueryInformation:
|
case PolicyAuditFullQueryInformation:
|
||||||
|
|
|
@ -113,6 +113,10 @@ NTSTATUS
|
||||||
LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject,
|
LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject,
|
||||||
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject,
|
||||||
|
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
||||||
PLSAPR_POLICY_INFORMATION *PolicyInformation);
|
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
|
NTSTATUS
|
||||||
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
|
||||||
PLSAPR_POLICY_INFORMATION *PolicyInformation)
|
PLSAPR_POLICY_INFORMATION *PolicyInformation)
|
||||||
|
|
Loading…
Reference in a new issue