[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".
This commit is contained in:
George Bișoc 2021-12-30 20:58:37 +01:00
parent 13cbc7fbf9
commit c9755651cd
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -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);