Author: ekohl
Date: Tue Sep 25 16:08:00 2012
New Revision: 57383
URL:
http://svn.reactos.org/svn/reactos?rev=57383&view=rev
Log:
[LSASRV]
- Set the default quota limits when the LSA database is created.
- Implement the PolicyDefaultQuotaInformation class of LsarQueryInformationPolicy.
Modified:
trunk/reactos/dll/win32/lsasrv/database.c
trunk/reactos/dll/win32/lsasrv/lsarpc.c
trunk/reactos/dll/win32/lsasrv/lsasrv.h
trunk/reactos/dll/win32/lsasrv/policy.c
Modified: trunk/reactos/dll/win32/lsasrv/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/database.…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] Tue Sep 25 16:08:00 2012
@@ -226,9 +226,18 @@
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);
@@ -263,6 +272,12 @@
L"PolAcDmS",
AccountDomainSid,
RtlLengthSid(AccountDomainSid));
+
+ /* Set the default quota limits attribute */
+ LsapSetObjectAttribute(PolicyObject,
+ L"DefQuota",
+ &QuotaInfo,
+ sizeof(POLICY_DEFAULT_QUOTA_INFO));
done:
if (PolicyObject != NULL)
Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Tue Sep 25 16:08:00 2012
@@ -248,6 +248,11 @@
PolicyInformation);
break;
+ case PolicyDefaultQuotaInformation: /* 8 */
+ Status = LsarQueryDefaultQuota(PolicyHandle,
+ PolicyInformation);
+ break;
+
case PolicyDnsDomainInformation: /* 12 (0xc) */
Status = LsarQueryDnsDomain(PolicyHandle,
PolicyInformation);
@@ -257,7 +262,6 @@
case PolicyPdAccountInformation:
case PolicyLsaServerRoleInformation:
case PolicyReplicaSourceInformation:
- case PolicyDefaultQuotaInformation:
case PolicyModificationInformation:
case PolicyAuditFullSetInformation:
case PolicyAuditFullQueryInformation:
Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Tue Sep 25 16:08:00 2012
@@ -114,6 +114,10 @@
PLSAPR_POLICY_INFORMATION *PolicyInformation);
NTSTATUS
+LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject,
+ PLSAPR_POLICY_INFORMATION *PolicyInformation);
+
+NTSTATUS
LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject,
PLSAPR_POLICY_INFORMATION *PolicyInformation);
Modified: trunk/reactos/dll/win32/lsasrv/policy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/policy.c?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] Tue Sep 25 16:08:00 2012
@@ -351,6 +351,38 @@
MIDL_user_free(p);
}
+ }
+
+ return Status;
+}
+
+
+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;