PsChargePoolQuota function (ntifs.h)

The PsChargePoolQuota routine charges pool quota of the specified pool type to the specified process.

Syntax

void PsChargePoolQuota(
  [in] PEPROCESS Process,
  [in] POOL_TYPE PoolType,
  [in] ULONG_PTR Amount
);

Parameters

[in] Process

Pointer to the process whose quota is to be charged.

[in] PoolType

Type of pool quota to charge, which can be one of the following:

  • NonPagedPool
  • PagedPool
  • NonPagedPoolCacheAligned
  • PagedPoolCacheAligned

The NonPagedPoolMustSucceed and NonPagedPoolCacheAlignedMustS pool types are obsolete and should no longer be used.

[in] Amount

Number of bytes to charge against the pool quota for this process.

Return value

None

Remarks

If insufficient quota exists for the process, quota is not charged, and PsChargePoolQuota raises an exception with the status value STATUS_QUOTA_EXCEEDED. Callers are responsible for handling this exception. Thus calls to PsChargePoolQuota must be wrapped within a driver-supplied exception handler.

Every successful call to PsChargePoolQuota must be matched by a subsequent call to PsReturnPoolQuota.

For more information about memory management, see Memory Management.

Requirements

Requirement Value
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

See also

PsReturnPoolQuota