mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[KMTESTS:EX] Add a test that triggers big pool expansion. CORE-15051
This commit is contained in:
parent
e7de564bfc
commit
e5fc2b4ce3
1 changed files with 42 additions and 0 deletions
|
@ -264,10 +264,52 @@ TestPoolQuota(VOID)
|
|||
KmtEndSeh(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
TestBigPoolExpansion(VOID)
|
||||
{
|
||||
POOL_TYPE PoolType;
|
||||
PVOID *BigAllocations;
|
||||
const ULONG MaxAllocations = 1024 * 128;
|
||||
ULONG NumAllocations;
|
||||
|
||||
for (PoolType = NonPagedPool; PoolType <= PagedPool; PoolType++)
|
||||
{
|
||||
BigAllocations = ExAllocatePoolWithTag(PoolType,
|
||||
MaxAllocations * sizeof(*BigAllocations),
|
||||
'ABmK');
|
||||
|
||||
/* Allocate a lot of pages (== big pool allocations) */
|
||||
for (NumAllocations = 0; NumAllocations < MaxAllocations; NumAllocations++)
|
||||
{
|
||||
BigAllocations[NumAllocations] = ExAllocatePoolWithTag(PoolType,
|
||||
PAGE_SIZE,
|
||||
'aPmK');
|
||||
if (BigAllocations[NumAllocations] == NULL)
|
||||
{
|
||||
NumAllocations--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
trace("Got %lu allocations for PoolType %d\n", NumAllocations, PoolType);
|
||||
|
||||
/* Free them */
|
||||
for (; NumAllocations < MaxAllocations; NumAllocations--)
|
||||
{
|
||||
ASSERT(BigAllocations[NumAllocations] != NULL);
|
||||
ExFreePoolWithTag(BigAllocations[NumAllocations],
|
||||
'aPmK');
|
||||
}
|
||||
ExFreePoolWithTag(BigAllocations, 'ABmK');
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(ExPools)
|
||||
{
|
||||
PoolsTest();
|
||||
PoolsCorruption();
|
||||
TestPoolTags();
|
||||
TestPoolQuota();
|
||||
TestBigPoolExpansion();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue