}
}
-/*
+/**********************************************************************
+ * NAME EXPORTED
+ * MmAllocateContiguousMemorySpecifyCache@32
+ *
+ * DESCRIPTION
+ * Allocates a range of physically contiguous memory
+ * with a cache parameter.
+ *
+ * ARGUMENTS
+ * NumberOfBytes
+ * Size of the memory block to allocate;
+ *
+ * LowestAcceptableAddress
+ * Lowest address valid for the caller.
+ *
+ * HighestAcceptableAddress
+ * Highest address valid for the caller.
+ *
+ * BoundaryAddressMultiple
+ * Address multiple not to be crossed by allocated buffer (optional).
+ *
+ * CacheType
+ * Type of caching to use.
+ *
+ * RETURN VALUE
+ * The virtual address of the memory block on success;
+ * NULL on error.
+ *
+ * REVISIONS
+ *
* @implemented
*/
PVOID STDCALL
-MmAllocateContiguousAlignedMemory(IN ULONG NumberOfBytes,
- IN PHYSICAL_ADDRESS LowestAcceptableAddress OPTIONAL,
- IN PHYSICAL_ADDRESS HighestAcceptableAddress,
- IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL,
- IN MEMORY_CACHING_TYPE CacheType OPTIONAL,
- IN ULONG Alignment)
+MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes,
+ IN PHYSICAL_ADDRESS LowestAcceptableAddress OPTIONAL,
+ IN PHYSICAL_ADDRESS HighestAcceptableAddress,
+ IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL,
+ IN MEMORY_CACHING_TYPE CacheType OPTIONAL)
{
PMEMORY_AREA MArea;
NTSTATUS Status;
&MArea,
FALSE,
FALSE,
- BoundaryAddressMultiple);
+ (PHYSICAL_ADDRESS)0LL);
MmUnlockAddressSpace(MmGetKernelAddressSpace());
if (!NT_SUCCESS(Status))
PBase = MmGetContinuousPages(NumberOfBytes,
LowestAcceptableAddress,
HighestAcceptableAddress,
- Alignment);
+ BoundaryAddressMultiple);
if (PBase == 0)
{
MmLockAddressSpace(MmGetKernelAddressSpace());
for (i = 0; i < (PAGE_ROUND_UP(NumberOfBytes) / PAGE_SIZE); i++, PBase++)
{
MmCreateVirtualMapping(NULL,
- (char*)BaseAddress + (i * 4096),
+ (char*)BaseAddress + (i * PAGE_SIZE),
Attributes,
&PBase,
1);
MmAllocateContiguousMemory (IN ULONG NumberOfBytes,
IN PHYSICAL_ADDRESS HighestAcceptableAddress)
{
- PHYSICAL_ADDRESS LowestAcceptableAddress;
- PHYSICAL_ADDRESS BoundaryAddressMultiple;
-
- LowestAcceptableAddress.QuadPart = 0;
- BoundaryAddressMultiple.QuadPart = 0;
-
- return(MmAllocateContiguousAlignedMemory(NumberOfBytes,
- LowestAcceptableAddress,
- HighestAcceptableAddress,
- BoundaryAddressMultiple,
- MmCached,
- PAGE_SIZE));
+ return MmAllocateContiguousMemorySpecifyCache(NumberOfBytes,
+ (PHYSICAL_ADDRESS)0LL,
+ HighestAcceptableAddress,
+ (PHYSICAL_ADDRESS)0LL,
+ MmCached);
}
MmUnlockAddressSpace(MmGetKernelAddressSpace());
}
-/**********************************************************************
- * NAME EXPORTED
- * MmAllocateContiguousMemorySpecifyCache@32
- *
- * DESCRIPTION
- * Allocates a range of physically contiguous memory
- * with a cache parameter.
- *
- * ARGUMENTS
- * NumberOfBytes
- * Size of the memory block to allocate;
- *
- * LowestAcceptableAddress
- * Lowest address valid for the caller.
- *
- * HighestAcceptableAddress
- * Highest address valid for the caller.
- *
- * BoundaryAddressMultiple
- * Address multiple not to be crossed by allocated buffer (optional).
- *
- * CacheType
- * Type of caching to use.
- *
- * RETURN VALUE
- * The virtual address of the memory block on success;
- * NULL on error.
- *
- * REVISIONS
- *
- * @implemented
- */
-PVOID STDCALL
-MmAllocateContiguousMemorySpecifyCache (IN ULONG NumberOfBytes,
- IN PHYSICAL_ADDRESS LowestAcceptableAddress,
- IN PHYSICAL_ADDRESS HighestAcceptableAddress,
- IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL,
- IN MEMORY_CACHING_TYPE CacheType)
-{
- return(MmAllocateContiguousAlignedMemory(NumberOfBytes,
- LowestAcceptableAddress,
- HighestAcceptableAddress,
- BoundaryAddressMultiple,
- CacheType,
- PAGE_SIZE));
-}
-
/**********************************************************************
* NAME EXPORTED
* MmFreeContiguousMemorySpecifyCache@12