ReactOS 0.4.16-dev-570-g1868985
|
#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
Macros | |
#define | NDEBUG |
#define | VALID_QUOTA_FLAGS |
Functions | |
_Requires_lock_held_ (PspQuotaLock) | |
Returns pool quotas back to the Memory Manager when the pool quota block is no longer being used by anybody. | |
NTSTATUS NTAPI | PspChargeProcessQuotaSpecifiedPool (_In_opt_ PEPROCESS Process, _In_ PEPROCESS_QUOTA_BLOCK QuotaBlock, _In_ PS_QUOTA_TYPE QuotaType, _In_ SIZE_T Amount) |
Internal kernel function that provides the bulk logic of process quota charging, necessary for exported kernel routines needed for quota management. | |
VOID NTAPI | PspReturnProcessQuotaSpecifiedPool (_In_opt_ PEPROCESS Process, _In_ PEPROCESS_QUOTA_BLOCK QuotaBlock, _In_ PS_QUOTA_TYPE QuotaType, _In_ SIZE_T Amount) |
Internal kernel function that provides the bulk logic of process quota returning. It returns (takes away) quotas back from a process and/or quota block, which is the opposite of charging quotas. | |
VOID NTAPI | PsInitializeQuotaSystem (VOID) |
Initializes the quota system during boot phase of the system, which sets up the default quota block that is used across several processes. | |
VOID NTAPI | PspInheritQuota (_In_ PEPROCESS Process, _In_opt_ PEPROCESS ParentProcess) |
Inherits the quota block to another newborn (child) process. If there's no parent process, the default quota block is assigned. | |
VOID NTAPI | PspInsertQuotaBlock (_In_ PEPROCESS_QUOTA_BLOCK QuotaBlock) |
Inserts the new quota block into the quota list. | |
VOID NTAPI | PspDereferenceQuotaBlock (_In_opt_ PEPROCESS Process, _In_ PEPROCESS_QUOTA_BLOCK QuotaBlock) |
De-references a quota block when quotas have been returned back because of an object de-allocation or when a process gets destroyed. If the last instance that held up the block gets de-referenced the function will perform a cleanup against that block and it'll free the quota block from memory. | |
VOID NTAPI | PsReturnSharedPoolQuota (_In_ PEPROCESS_QUOTA_BLOCK QuotaBlock, _In_ SIZE_T AmountToReturnPaged, _In_ SIZE_T AmountToReturnNonPaged) |
Returns the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota returns handling of objects. | |
PEPROCESS_QUOTA_BLOCK NTAPI | PsChargeSharedPoolQuota (_In_ PEPROCESS Process, _In_ SIZE_T AmountToChargePaged, _In_ SIZE_T AmountToChargeNonPaged) |
Charges the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota charges handling of objects. | |
NTSTATUS NTAPI | PsChargeProcessPageFileQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Charges the process page file quota. The function is used internally by the kernel. | |
VOID NTAPI | PsChargePoolQuota (_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount) |
Charges the pool quota of a given process. The kind of pool quota to charge is determined by the PoolType parameter. | |
NTSTATUS NTAPI | PsChargeProcessNonPagedPoolQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Charges the non paged pool quota of a given process. | |
NTSTATUS NTAPI | PsChargeProcessPagedPoolQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Charges the paged pool quota of a given process. | |
NTSTATUS NTAPI | PsChargeProcessPoolQuota (_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount) |
Charges the process' quota pool. The type of quota to be charged depends upon the PoolType parameter. | |
VOID NTAPI | PsReturnPoolQuota (_In_ PEPROCESS Process, _In_ POOL_TYPE PoolType, _In_ SIZE_T Amount) |
Returns the pool quota that the process was taking up. | |
VOID NTAPI | PsReturnProcessNonPagedPoolQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Returns the non paged quota pool that the process was taking up. | |
VOID NTAPI | PsReturnProcessPagedPoolQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Returns the paged pool quota that the process was taking up. | |
NTSTATUS NTAPI | PsReturnProcessPageFileQuota (_In_ PEPROCESS Process, _In_ SIZE_T Amount) |
Returns the page file quota that the process was taking up. The function is used exclusively by the kernel. | |
NTSTATUS NTAPI | PspSetQuotaLimits (_In_ PEPROCESS Process, _In_ ULONG Unused, _In_ PVOID QuotaLimits, _In_ ULONG QuotaLimitsLength, _In_ KPROCESSOR_MODE PreviousMode) |
This function adjusts the working set limits of a process and sets up new quota limits when necessary. The function is used when the caller requests to set up new working set sizes. | |
Variables | |
EPROCESS_QUOTA_BLOCK | PspDefaultQuotaBlock |
static LIST_ENTRY | PspQuotaBlockList = {&PspQuotaBlockList, &PspQuotaBlockList} |
static KSPIN_LOCK | PspQuotaLock |
#define VALID_QUOTA_FLAGS |
_Requires_lock_held_ | ( | PspQuotaLock | ) |
Returns pool quotas back to the Memory Manager when the pool quota block is no longer being used by anybody.
Releases some of excess quotas in order to attempt free up some resources. This is done primarily in in case the Memory Manager fails to raise the quota limit.
[in] | QuotaBlock | The pool quota block of which quota resources are to be sent back. |
[in] | QuotaType | Process pool quota type. |
[out] | ReturnedQuotas | A pointer to the returned amount of quotas back to Memory Manager. |
Definition at line 47 of file quota.c.
VOID NTAPI PsChargePoolQuota | ( | _In_ PEPROCESS | Process, |
_In_ POOL_TYPE | PoolType, | ||
_In_ SIZE_T | Amount | ||
) |
Charges the pool quota of a given process. The kind of pool quota to charge is determined by the PoolType parameter.
[in] | Process | The process which quota is to be charged. |
[in] | PoolType | The pool type to choose to charge quotas (e.g. PagedPool or NonPagedPool). |
[in] | Amount | The amount of quotas to charge into a process. |
Definition at line 775 of file quota.c.
Referenced by FsRtlCancelNotify(), and FsRtlNotifyFilterReportChange().
Charges the non paged pool quota of a given process.
[in] | Process | The process which non paged quota is to be charged. |
[in] | Amount | The amount of quotas to charge into a process. |
Definition at line 811 of file quota.c.
Referenced by MiCreatePebOrTeb(), MiMapLockedPagesInUserSpace(), MiMapViewOfDataSection(), NtAllocateVirtualMemory(), NtFreeVirtualMemory(), and START_TEST().
Charges the paged pool quota of a given process.
[in] | Process | The process which paged quota is to be charged. |
[in] | Amount | The amount of quotas to charge into a process. |
Definition at line 839 of file quota.c.
Referenced by ExpAllocateHandleTable(), ExpAllocateTablePagedPool(), ExpAllocateTablePagedPoolNoZero(), and START_TEST().
Charges the process page file quota. The function is used internally by the kernel.
[in] | Process | The process which page file quota is to be charged. |
[in] | Amount | The amount of page file quota to charge. |
Definition at line 738 of file quota.c.
NTSTATUS NTAPI PsChargeProcessPoolQuota | ( | _In_ PEPROCESS | Process, |
_In_ POOL_TYPE | PoolType, | ||
_In_ SIZE_T | Amount | ||
) |
Charges the process' quota pool. The type of quota to be charged depends upon the PoolType parameter.
[in] | Process | The process which quota is to be charged. |
[in] | PoolType | The type of quota pool to charge (e.g. PagedPool or NonPagedPool). |
[in] | Amount | The amount of quotas to charge into a process. |
Definition at line 872 of file quota.c.
Referenced by ExAllocatePoolWithQuotaTag(), PsChargePoolQuota(), PsChargeProcessNonPagedPoolQuota(), and PsChargeProcessPagedPoolQuota().
PEPROCESS_QUOTA_BLOCK NTAPI PsChargeSharedPoolQuota | ( | _In_ PEPROCESS | Process, |
_In_ SIZE_T | AmountToChargePaged, | ||
_In_ SIZE_T | AmountToChargeNonPaged | ||
) |
Charges the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota charges handling of objects.
[in] | Process | The process which quotas are to be charged within its quota block. |
[in] | AmountToChargePaged | The amount of paged quotas quotas to be charged. |
[in] | AmountToChargeNonPaged | The amount of non paged quotas to be charged. |
Definition at line 674 of file quota.c.
Referenced by ObpChargeQuotaForObject().
Initializes the quota system during boot phase of the system, which sets up the default quota block that is used across several processes.
Definition at line 443 of file quota.c.
Referenced by ObInitSystem().
NTSTATUS NTAPI PspChargeProcessQuotaSpecifiedPool | ( | _In_opt_ PEPROCESS | Process, |
_In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock, | ||
_In_ PS_QUOTA_TYPE | QuotaType, | ||
_In_ SIZE_T | Amount | ||
) |
Internal kernel function that provides the bulk logic of process quota charging, necessary for exported kernel routines needed for quota management.
[in] | Process | A process, represented as a EPROCESS object. This parameter is used to charge the own process' quota usage. |
[in] | QuotaBlock | The quota block which quotas are to be charged. This block can either come from the process itself or from an object with specified quota charges. |
[in] | QuotaType | The quota type which quota in question is to be charged. The permitted types are PsPagedPool, PsNonPagedPool and PsPageFile. |
[in] | Amount | The amount of quota to be charged. |
Definition at line 195 of file quota.c.
Referenced by PsChargeProcessPageFileQuota(), PsChargeProcessPoolQuota(), and PsChargeSharedPoolQuota().
VOID NTAPI PspDereferenceQuotaBlock | ( | _In_opt_ PEPROCESS | Process, |
_In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock | ||
) |
De-references a quota block when quotas have been returned back because of an object de-allocation or when a process gets destroyed. If the last instance that held up the block gets de-referenced the function will perform a cleanup against that block and it'll free the quota block from memory.
[in] | Process | A pointer to a process that de-references the quota block. |
[in] | QuotaBlock | A pointer to a quota block that is to be de-referenced. This block can come from a process that references it or an object. |
Definition at line 553 of file quota.c.
Referenced by PspDeleteProcess(), and PsReturnSharedPoolQuota().
Inherits the quota block to another newborn (child) process. If there's no parent process, the default quota block is assigned.
[in] | Process | The child process which quota block is to be given. |
[in] | ParentProcess | The parent process. |
Definition at line 483 of file quota.c.
VOID NTAPI PspInsertQuotaBlock | ( | _In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock | ) |
Inserts the new quota block into the quota list.
[in] | QuotaBlock | The new quota block. |
Definition at line 518 of file quota.c.
Referenced by PspSetQuotaLimits().
VOID NTAPI PspReturnProcessQuotaSpecifiedPool | ( | _In_opt_ PEPROCESS | Process, |
_In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock, | ||
_In_ PS_QUOTA_TYPE | QuotaType, | ||
_In_ SIZE_T | Amount | ||
) |
Internal kernel function that provides the bulk logic of process quota returning. It returns (takes away) quotas back from a process and/or quota block, which is the opposite of charging quotas.
[in] | Process | A process, represented as a EPROCESS object. This parameter is used to return the own process' quota usage. |
[in] | QuotaBlock | The quota block which quotas are to be returned. This block can either come from the process itself or from an object with specified quota charges. |
[in] | QuotaType | The quota type which quota in question is to be returned. The permitted types are PsPagedPool, PsNonPagedPool and PsPageFile. |
[in] | Amount | The amount of quota to be returned. |
Definition at line 345 of file quota.c.
Referenced by PsChargeSharedPoolQuota(), PsReturnPoolQuota(), PsReturnProcessPageFileQuota(), and PsReturnSharedPoolQuota().
NTSTATUS NTAPI PspSetQuotaLimits | ( | _In_ PEPROCESS | Process, |
_In_ ULONG | Unused, | ||
_In_ PVOID | QuotaLimits, | ||
_In_ ULONG | QuotaLimitsLength, | ||
_In_ KPROCESSOR_MODE | PreviousMode | ||
) |
This function adjusts the working set limits of a process and sets up new quota limits when necessary. The function is used when the caller requests to set up new working set sizes.
[in] | Process | The process which quota limits or working set sizes are to be changed. |
[in] | Unused | This parameter is unused. |
[in] | QuotaLimits | An arbitrary pointer that points to a quota limits structure, needed to determine on setting up new working set sizes. |
[in] | QuotaLimitsLength | The length of QuotaLimits buffer, which size is expressed in bytes. |
[in] | PreviousMode | The processor level access mode. |
Definition at line 1045 of file quota.c.
Referenced by NtSetInformationProcess().
VOID NTAPI PsReturnPoolQuota | ( | _In_ PEPROCESS | Process, |
_In_ POOL_TYPE | PoolType, | ||
_In_ SIZE_T | Amount | ||
) |
Returns the pool quota that the process was taking up.
[in] | Process | The process which quota is to be returned. |
[in] | PoolType | The type of quota pool to return (e.g. PagedPool or NonPagedPool). |
[in] | Amount | The amount of quotas to return from a process. |
Definition at line 907 of file quota.c.
Referenced by ExFreePoolWithTag(), ExReturnPoolQuota(), PsReturnProcessNonPagedPoolQuota(), and PsReturnProcessPagedPoolQuota().
NTKERNELAPI VOID NTAPI PsReturnProcessNonPagedPoolQuota | ( | _In_ PEPROCESS | Process, |
_In_ SIZE_T | Amount | ||
) |
Returns the non paged quota pool that the process was taking up.
[in] | Process | The process which non paged quota is to be returned. |
[in] | Amount | The amount of quotas to return from a process. |
Definition at line 938 of file quota.c.
Referenced by MiCreatePebOrTeb(), MiMapLockedPagesInUserSpace(), MiMapViewOfDataSection(), MiUnmapLockedPagesInUserSpace(), MiUnmapViewOfSection(), MmCleanProcessAddressSpace(), MmDeleteTeb(), NtAllocateVirtualMemory(), NtFreeVirtualMemory(), PspDeleteProcess(), and START_TEST().
Returns the paged pool quota that the process was taking up.
[in] | Process | The process which paged pool quota is to be returned. |
[in] | Amount | The amount of quotas to return from a process. |
Definition at line 965 of file quota.c.
Referenced by ExpAllocateHandleTable(), ExpFreeHandleTable(), ExpFreeTablePagedPool(), FsRtlCancelNotify(), FsRtlNotifyCleanup(), FsRtlNotifyCompleteIrp(), FsRtlNotifyFilterReportChange(), and START_TEST().
Returns the page file quota that the process was taking up. The function is used exclusively by the kernel.
[in] | Process | The process which pagefile quota is to be returned. |
[in] | Amount | The amount of quotas to return from a process. |
Definition at line 993 of file quota.c.
VOID NTAPI PsReturnSharedPoolQuota | ( | _In_ PEPROCESS_QUOTA_BLOCK | QuotaBlock, |
_In_ SIZE_T | AmountToReturnPaged, | ||
_In_ SIZE_T | AmountToReturnNonPaged | ||
) |
Returns the shared (paged and non paged) pool quotas. The function is used exclusively by the Object Manager to manage quota returns handling of objects.
[in] | QuotaBlock | The quota block which quotas are to be returned. |
[in] | AmountToReturnPaged | The amount of paged quotas quotas to be returned. |
[in] | AmountToReturnNonPaged | The amount of non paged quotas to be returned. |
Definition at line 621 of file quota.c.
Referenced by ObpDeallocateObject().
EPROCESS_QUOTA_BLOCK PspDefaultQuotaBlock |
Definition at line 16 of file quota.c.
Referenced by NtQueryInformationProcess(), PsInitializeQuotaSystem(), PspChargeProcessQuotaSpecifiedPool(), PspDereferenceQuotaBlock(), PspInheritQuota(), PspReturnProcessQuotaSpecifiedPool(), and PspSetQuotaLimits().
|
static |
Definition at line 17 of file quota.c.
Referenced by PspInsertQuotaBlock().
|
static |
Definition at line 18 of file quota.c.
Referenced by PspChargeProcessQuotaSpecifiedPool(), PspDereferenceQuotaBlock(), PspInsertQuotaBlock(), and PspReturnProcessQuotaSpecifiedPool().