MmAllocateContiguousMemorySpecifyCache provides high, low, and boundary
parameters that allow you to select where the memory is located.
AllocateCommonBuffer is just a front end to this with the logical
address abstraction tossed in and less control over the memory cache
type.
-----Original Message-----
I’ll give you an example. Let’s say you have a bus-mastering PCI device
that only handles 32-bit physical addresses, as many do. Let’s say
you’re running on a Server 2003 system with 16GB of RAM. Statistically,
it’s quite likely that MmAllocateContiguousMemorySpecifyCache is going
to return you memory with a physical address beyond the 4GB mark. Your
hardware can’t handle that. You’re stuck.
IoGetDmaAdapter, on the other hand, will do whatever needs to be done,
by allocating “bounce buffers” within the first 4GB of physical RAM, and
making sure that the physical addresses you get are all within the range
for your device.