From d37d315a7ecbd74ecdc50b2826563f75b79cf84d Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Fri, 16 Oct 2009 00:28:33 +0000 Subject: [PATCH] - 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 --- reactos/ntoskrnl/mm/ARM3/expool.c | 66 ++++++++++++++ reactos/ntoskrnl/mm/ARM3/pool.c | 40 ++++++++ reactos/ntoskrnl/mm/pool.c | 146 ------------------------------ 3 files changed, 106 insertions(+), 146 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/expool.c b/reactos/ntoskrnl/mm/ARM3/expool.c index 3f797197b81..8ae73ec8883 100644 --- a/reactos/ntoskrnl/mm/ARM3/expool.c +++ b/reactos/ntoskrnl/mm/ARM3/expool.c @@ -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 */ diff --git a/reactos/ntoskrnl/mm/ARM3/pool.c b/reactos/ntoskrnl/mm/ARM3/pool.c index 516b674f666..889ed0a148e 100644 --- a/reactos/ntoskrnl/mm/ARM3/pool.c +++ b/reactos/ntoskrnl/mm/ARM3/pool.c @@ -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 */ diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index bb5c40fb913..5b8125a6205 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -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 */