mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:23:01 +00:00
- Fix comments.
- Fix reading the incorrect pool type when freeing pool. The PoolType in the entry is offset by 1, so it can be either 1 for NonPaged or 2 for paged. This used to give us index 0 for nonpaged (correct), and index -1 for paged (oops!). Mask by 3 instead, so we get 0 and 1. svn path=/trunk/; revision=43489
This commit is contained in:
parent
3b34847f3e
commit
657da0b009
1 changed files with 7 additions and 7 deletions
|
@ -241,7 +241,7 @@ ExAllocateArmPoolWithTag(IN POOL_TYPE PoolType,
|
||||||
if (!IsListEmpty(ListHead))
|
if (!IsListEmpty(ListHead))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Acquire the nonpaged pool lock now
|
// Acquire the pool lock now
|
||||||
//
|
//
|
||||||
OldIrql = ExLockPool(PoolDesc);
|
OldIrql = ExLockPool(PoolDesc);
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ ExAllocateArmPoolWithTag(IN POOL_TYPE PoolType,
|
||||||
if (FragmentEntry->BlockSize != 1)
|
if (FragmentEntry->BlockSize != 1)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Excellent -- acquire the nonpaged pool lock
|
// Excellent -- acquire the pool lock
|
||||||
//
|
//
|
||||||
OldIrql = ExLockPool(PoolDesc);
|
OldIrql = ExLockPool(PoolDesc);
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ ExAllocateArmPoolWithTag(IN POOL_TYPE PoolType,
|
||||||
(PLIST_ENTRY)FragmentEntry + 1);
|
(PLIST_ENTRY)FragmentEntry + 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Release the nonpaged pool lock
|
// Release the pool lock
|
||||||
//
|
//
|
||||||
ExUnlockPool(PoolDesc, OldIrql);
|
ExUnlockPool(PoolDesc, OldIrql);
|
||||||
}
|
}
|
||||||
|
@ -487,7 +487,7 @@ ExFreeArmPoolWithTag(IN PVOID P,
|
||||||
// for this pool type
|
// for this pool type
|
||||||
//
|
//
|
||||||
BlockSize = Entry->BlockSize;
|
BlockSize = Entry->BlockSize;
|
||||||
PoolType = (Entry->PoolType & BASE_POOL_TYPE_MASK) - 1;
|
PoolType = (Entry->PoolType & 3) - 1;
|
||||||
PoolDesc = PoolVector[PoolType];
|
PoolDesc = PoolVector[PoolType];
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -496,7 +496,7 @@ ExFreeArmPoolWithTag(IN PVOID P,
|
||||||
NextEntry = Entry + BlockSize;
|
NextEntry = Entry + BlockSize;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Acquire the nonpaged pool lock
|
// Acquire the pool lock
|
||||||
//
|
//
|
||||||
OldIrql = ExLockPool(PoolDesc);
|
OldIrql = ExLockPool(PoolDesc);
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ ExFreeArmPoolWithTag(IN PVOID P,
|
||||||
(PAGE_ALIGN(Entry + Entry->BlockSize) == Entry + Entry->BlockSize))
|
(PAGE_ALIGN(Entry + Entry->BlockSize) == Entry + Entry->BlockSize))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// In this case, release the nonpaged pool lock, and free the page
|
// In this case, release the pool lock, and free the page
|
||||||
//
|
//
|
||||||
ExUnlockPool(PoolDesc, OldIrql);
|
ExUnlockPool(PoolDesc, OldIrql);
|
||||||
MiFreePoolPages(Entry);
|
MiFreePoolPages(Entry);
|
||||||
|
@ -621,7 +621,7 @@ ExFreeArmPoolWithTag(IN PVOID P,
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Insert this new free block, and release the nonpaged pool lock
|
// Insert this new free block, and release the pool lock
|
||||||
//
|
//
|
||||||
InsertHeadList(&PoolDesc->ListHeads[BlockSize - 1], (PLIST_ENTRY)Entry + 1);
|
InsertHeadList(&PoolDesc->ListHeads[BlockSize - 1], (PLIST_ENTRY)Entry + 1);
|
||||||
ExUnlockPool(PoolDesc, OldIrql);
|
ExUnlockPool(PoolDesc, OldIrql);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue