mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
- Move some unimplemented Ex* Pool routines into ARM3's expool.c.
- Move some unimplemented Mm* Pool routines into ARM3's pool.c. svn path=/trunk/; revision=43508
This commit is contained in:
parent
c0bb477b78
commit
d37d315a7e
3 changed files with 106 additions and 146 deletions
|
@ -16,6 +16,9 @@
|
|||
#define MODULE_INVOLVED_IN_ARM3
|
||||
#include "../ARM3/miarm.h"
|
||||
|
||||
#undef ExAllocatePoolWithQuota
|
||||
#undef ExAllocatePoolWithQuotaTag
|
||||
|
||||
/* GLOBALS ********************************************************************/
|
||||
|
||||
POOL_DESCRIPTOR NonPagedPoolDescriptor;
|
||||
|
@ -637,4 +640,67 @@ ExFreeArmPool(PVOID P)
|
|||
ExFreeArmPoolWithTag(P, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
SIZE_T
|
||||
NTAPI
|
||||
ExQueryPoolBlockSize(IN PVOID PoolBlock,
|
||||
OUT PBOOLEAN QuotaCharged)
|
||||
{
|
||||
//
|
||||
// Not implemented
|
||||
//
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
||||
PVOID
|
||||
NTAPI
|
||||
ExAllocatePoolWithQuota(IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes)
|
||||
{
|
||||
//
|
||||
// Allocate the pool
|
||||
//
|
||||
return ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, 'enoN');
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType,
|
||||
IN SIZE_T NumberOfBytes,
|
||||
IN ULONG Tag,
|
||||
IN EX_POOL_PRIORITY Priority)
|
||||
{
|
||||
//
|
||||
// Allocate the pool
|
||||
//
|
||||
UNIMPLEMENTED;
|
||||
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
ExAllocatePoolWithQuotaTag(IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag)
|
||||
{
|
||||
//
|
||||
// Allocate the pool
|
||||
//
|
||||
UNIMPLEMENTED;
|
||||
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -711,4 +711,44 @@ MiFreePoolPages(IN PVOID StartingVa)
|
|||
return NumberOfPages;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MiRaisePoolQuota(IN POOL_TYPE PoolType,
|
||||
IN ULONG CurrentMaxQuota,
|
||||
OUT PULONG NewMaxQuota)
|
||||
{
|
||||
//
|
||||
// Not implemented
|
||||
//
|
||||
UNIMPLEMENTED;
|
||||
*NewMaxQuota = CurrentMaxQuota + 65536;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS ***********************************************************/
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
MmAllocateMappingAddress(IN SIZE_T NumberOfBytes,
|
||||
IN ULONG PoolTag)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
NTAPI
|
||||
MmFreeMappingAddress(IN PVOID BaseAddress,
|
||||
IN ULONG PoolTag)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -165,79 +165,6 @@ ExAllocatePoolWithTag (POOL_TYPE PoolType, ULONG NumberOfBytes, ULONG Tag)
|
|||
return(Block);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
#undef ExAllocatePoolWithQuota
|
||||
#undef ExAllocatePoolWithQuotaTag
|
||||
PVOID NTAPI
|
||||
ExAllocatePoolWithQuota (POOL_TYPE PoolType, ULONG NumberOfBytes)
|
||||
{
|
||||
return(ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, TAG_NONE));
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
ExAllocatePoolWithTagPriority(
|
||||
IN POOL_TYPE PoolType,
|
||||
IN SIZE_T NumberOfBytes,
|
||||
IN ULONG Tag,
|
||||
IN EX_POOL_PRIORITY Priority
|
||||
)
|
||||
{
|
||||
/* Do the allocation */
|
||||
UNIMPLEMENTED;
|
||||
return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType,
|
||||
IN ULONG NumberOfBytes,
|
||||
IN ULONG Tag)
|
||||
{
|
||||
PEPROCESS Process;
|
||||
PVOID Block;
|
||||
|
||||
/* Allocate the Pool First */
|
||||
Block = EiAllocatePool(PoolType,
|
||||
NumberOfBytes,
|
||||
Tag,
|
||||
&ExAllocatePoolWithQuotaTag);
|
||||
|
||||
/* "Quota is not charged to the thread for allocations >= PAGE_SIZE" - OSR Docs */
|
||||
if (!(NumberOfBytes >= PAGE_SIZE))
|
||||
{
|
||||
/* Get the Current Process */
|
||||
Process = PsGetCurrentProcess();
|
||||
|
||||
/* PsChargePoolQuota returns an exception, so this needs SEH */
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* FIXME: Is there a way to get the actual Pool size allocated from the pool header? */
|
||||
PsChargePoolQuota(Process,
|
||||
PoolType & PAGED_POOL_MASK,
|
||||
NumberOfBytes);
|
||||
}
|
||||
_SEH2_EXCEPT((ExFreePool(Block), EXCEPTION_CONTINUE_SEARCH))
|
||||
{
|
||||
/* Quota Exceeded and the caller had no SEH! */
|
||||
KeBugCheck(STATUS_QUOTA_EXCEEDED);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
|
||||
/* Return the allocated block */
|
||||
return Block;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -307,77 +234,4 @@ ExFreePoolWithTag(
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
SIZE_T
|
||||
NTAPI
|
||||
ExQueryPoolBlockSize (
|
||||
IN PVOID PoolBlock,
|
||||
OUT PBOOLEAN QuotaCharged
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
PVOID
|
||||
NTAPI
|
||||
MmAllocateMappingAddress (
|
||||
IN SIZE_T NumberOfBytes,
|
||||
IN ULONG PoolTag
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
NTAPI
|
||||
MmFreeMappingAddress (
|
||||
IN PVOID BaseAddress,
|
||||
IN ULONG PoolTag
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MiRaisePoolQuota(
|
||||
IN POOL_TYPE PoolType,
|
||||
IN ULONG CurrentMaxQuota,
|
||||
OUT PULONG NewMaxQuota
|
||||
)
|
||||
{
|
||||
/* Different quota raises depending on the type (64K vs 512K) */
|
||||
if (PoolType == PagedPool) {
|
||||
|
||||
/* Make sure that 4MB is still left */
|
||||
if ((MM_PAGED_POOL_SIZE >> 12) < ((MmPagedPoolSize + 4194304) >> 12)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Increase Paged Pool Quota by 512K */
|
||||
MmTotalPagedPoolQuota += 524288;
|
||||
*NewMaxQuota = CurrentMaxQuota + 524288;
|
||||
return TRUE;
|
||||
|
||||
} else { /* Nonpaged Pool */
|
||||
|
||||
/* Check if we still have 200 pages free*/
|
||||
if (MmStats.NrFreePages < 200) return FALSE;
|
||||
|
||||
*NewMaxQuota = CurrentMaxQuota + 65536;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue