Author: ion
Date: Fri Sep 13 08:00:16 2013
New Revision: 60071
URL:
http://svn.reactos.org/svn/reactos?rev=60071&view=rev
Log:
[NTOSKRNL]: Activate the pseudo-quota system. It doesnt' do much but at least it can
silence the debug spam. I think mike wrote it..
Modified:
trunk/reactos/ntoskrnl/ps/quota.c
Modified: trunk/reactos/ntoskrnl/ps/quota.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/quota.c?rev=60…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/quota.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/quota.c [iso-8859-1] Fri Sep 13 08:00:16 2013
@@ -16,15 +16,7 @@
EPROCESS_QUOTA_BLOCK PspDefaultQuotaBlock;
-
-/* Define this macro to enable quota code testing. Once quota code is */
-/* stable and verified, remove this macro and checks for it. */
-/*#define PS_QUOTA_ENABLE_QUOTA_CODE*/
-
-
/* PRIVATE FUNCTIONS *******************************************************/
-
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
/*
* Private helper to charge the specified process quota.
@@ -49,7 +41,9 @@
if (Process->QuotaUsage[PoolIndex] + Amount >
Process->QuotaBlock->QuotaEntry[PoolIndex].Limit)
{
- return STATUS_QUOTA_EXCEEDED; /* caller raises the exception */
+ DPRINT1("Quota exceeded, but ROS will let it slide...\n");
+ return STATUS_SUCCESS;
+ //return STATUS_QUOTA_EXCEEDED; /* caller raises the exception */
}
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], Amount);
@@ -62,7 +56,6 @@
return STATUS_SUCCESS;
}
-
/*
* Private helper to remove quota charge from the specified process quota.
@@ -91,9 +84,6 @@
}
}
-#endif /* PS_QUOTA_ENABLE_QUOTA_CODE */
-
-
/* FUNCTIONS ***************************************************************/
VOID
@@ -139,6 +129,9 @@
}
}
+/*
+ * @implemented
+ */
NTSTATUS
NTAPI
PsChargeProcessPageFileQuota(IN PEPROCESS Process,
@@ -147,13 +140,7 @@
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return STATUS_SUCCESS;
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
return PspChargeProcessQuotaSpecifiedPool(Process, 2, Amount);
-#else
- /* Otherwise, not implemented */
- UNIMPLEMENTED;
- return STATUS_SUCCESS;
-#endif
}
/*
@@ -166,12 +153,7 @@
IN SIZE_T Amount)
{
NTSTATUS Status;
-
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
- /* MS-documented IRQL requirement. Not yet enabled as it */
- /* needs verification that it does not break ReactOS, */
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
-#endif
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return;
@@ -217,18 +199,13 @@
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return STATUS_SUCCESS;
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
return PspChargeProcessQuotaSpecifiedPool(Process,
(PoolType & PAGED_POOL_MASK),
Amount);
-#else
- UNIMPLEMENTED;
- return STATUS_SUCCESS;
-#endif
-}
-
-/*
- * @unimplemented
+}
+
+/*
+ * @implemented
*/
VOID
NTAPI
@@ -236,26 +213,16 @@
IN POOL_TYPE PoolType,
IN SIZE_T Amount)
{
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
- /* MS-documented IRQL requirement. Not yet enabled as it */
- /* needs verification that it does not break ReactOS, */
- ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL);
-#endif
-
- /* Don't do anything for the system process */
- if (Process == PsInitialSystemProcess) return;
-
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
+ /* Don't do anything for the system process */
+ if (Process == PsInitialSystemProcess) return;
+
PspReturnProcessQuotaSpecifiedPool(Process,
(PoolType & PAGED_POOL_MASK),
Amount);
-#else
- UNIMPLEMENTED;
-#endif
-}
-
-/*
- * @unimplemented
+}
+
+/*
+ * @implemented
*/
VOID
NTAPI
@@ -265,15 +232,11 @@
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return;
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
PsReturnPoolQuota(Process, NonPagedPool, Amount);
-#else
- UNIMPLEMENTED;
-#endif
-}
-
-/*
- * @unimplemented
+}
+
+/*
+ * @implemented
*/
VOID
NTAPI
@@ -283,13 +246,12 @@
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return;
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
PsReturnPoolQuota(Process, PagedPool, Amount);
-#else
- UNIMPLEMENTED;
-#endif
-}
-
+}
+
+/*
+ * @implemented
+ */
NTSTATUS
NTAPI
PsReturnProcessPageFileQuota(IN PEPROCESS Process,
@@ -298,12 +260,7 @@
/* Don't do anything for the system process */
if (Process == PsInitialSystemProcess) return STATUS_SUCCESS;
-#ifdef PS_QUOTA_ENABLE_QUOTA_CODE
PspReturnProcessQuotaSpecifiedPool(Process, 2, Amount);
-#else
- /* Otherwise, not implemented */
- UNIMPLEMENTED;
-#endif
return STATUS_SUCCESS;
}