[NTOS:PS] Declare some prototypes and annotate the quota functions with SAL
authorGeorge Bișoc <george.bisoc@reactos.org>
Thu, 30 Dec 2021 19:58:37 +0000 (20:58 +0100)
committerGeorge Bișoc <george.bisoc@reactos.org>
Tue, 11 Jan 2022 09:11:09 +0000 (10:11 +0100)
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

index fab63a9..7f55554 100644 (file)
 //
 #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);