https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c9755651cdeeb2c940813…
commit c9755651cdeeb2c9408135dbe10bb586343a9b61
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Thu Dec 30 20:58:37 2021 +0100
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Tue Jan 11 10:11:09 2022 +0100
[NTOS:PS] Declare some prototypes and annotate the quota functions with SAL
Declare PsReturnSharedPoolQuota and PsChargeSharedPoolQuota prototypes and annotate
the functions. Furthermore, add two definitions related to quota pool limits threshold --
PSP_NON_PAGED_POOL_QUOTA_THRESHOLD and PSP_PAGED_POOL_QUOTA_THRESHOLD. For further
details, see the commit description of "[NTOS:MM] Add the pool quota prototypes and
some definitions".
---
ntoskrnl/include/internal/ps.h | 62 ++++++++++++++++++++++++++++--------------
1 file changed, 41 insertions(+), 21 deletions(-)
diff --git a/ntoskrnl/include/internal/ps.h b/ntoskrnl/include/internal/ps.h
index fab63a9b8d0..7f55554f890 100644
--- a/ntoskrnl/include/internal/ps.h
+++ b/ntoskrnl/include/internal/ps.h
@@ -70,6 +70,12 @@
//
#define PSP_JOB_SCHEDULING_CLASSES 10
+//
+// Process Quota Threshold Values
+//
+#define PSP_NON_PAGED_POOL_QUOTA_THRESHOLD 0x10000
+#define PSP_PAGED_POOL_QUOTA_THRESHOLD 0x80000
+
//
// Thread "Set/Get Context" Context Structure
//
@@ -292,14 +298,45 @@ PsIdleThreadMain(
VOID
NTAPI
PspInheritQuota(
- IN PEPROCESS Process,
- IN PEPROCESS ParentProcess
+ _In_ PEPROCESS Process,
+ _In_ PEPROCESS ParentProcess
);
VOID
NTAPI
-PspDestroyQuotaBlock(
- IN PEPROCESS Process
+PspDereferenceQuotaBlock(
+ _In_opt_ PEPROCESS Process,
+ _In_ PEPROCESS_QUOTA_BLOCK QuotaBlock
+);
+
+NTSTATUS
+NTAPI
+PsReturnProcessPageFileQuota(
+ _In_ PEPROCESS Process,
+ _In_ SIZE_T Amount
+);
+
+NTSTATUS
+NTAPI
+PsChargeProcessPageFileQuota(
+ _In_ PEPROCESS Process,
+ _In_ SIZE_T Amount
+);
+
+VOID
+NTAPI
+PsReturnSharedPoolQuota(
+ _In_ PEPROCESS_QUOTA_BLOCK QuotaBlock,
+ _In_ SIZE_T AmountToReturnPaged,
+ _In_ SIZE_T AmountToReturnNonPaged
+);
+
+PEPROCESS_QUOTA_BLOCK
+NTAPI
+PsChargeSharedPoolQuota(
+ _In_ PEPROCESS Process,
+ _In_ SIZE_T AmountToChargePaged,
+ _In_ SIZE_T AmountToChargeNonPaged
);
NTSTATUS
@@ -394,23 +431,6 @@ PspGetOrSetContextKernelRoutine(
IN OUT PVOID* SystemArgument2
);
-//
-// Process Quotas
-//
-NTSTATUS
-NTAPI
-PsReturnProcessPageFileQuota(
- IN PEPROCESS Process,
- IN SIZE_T Amount
-);
-
-NTSTATUS
-NTAPI
-PsChargeProcessPageFileQuota(
- IN PEPROCESS Process,
- IN SIZE_T Amount
-);
-
BOOLEAN
NTAPI
PspIsProcessExiting(IN PEPROCESS Process);