Memory allocation within a range

Hi,
while allocating memory ExAllocatePoolWithTag() function gives memory from anywhere available in memory. Is there any other API available which can allocate memory from a specified address range?
Thank you,
Hitesh

What bigger problem are you trying to solve?

Bent from my phone


From: xxxxx@lists.osr.com on behalf of xxxxx@yahoo.co.in
Sent: Wednesday, February 22, 2017 9:17:25 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Memory allocation within a range

Hi,
while allocating memory ExAllocatePoolWithTag() function gives memory from anywhere available in memory. Is there any other API available which can allocate memory from a specified address range?
Thank you,
Hitesh


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

the problem is with the end device connected at pcie port, which needs memory from the specific range because of the limitation. I am referring to physical memory here

xxxxx@yahoo.co.in wrote:

the problem is with the end device connected at pcie port, which needs memory from the specific range because of the limitation. I am referring to physical memory here

Are you talking about a poorly-designed DMA engine device that only
handles 32-bit addressing? You can use AllocateCommonBuffer to allocate
space below the 4GB boundary.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you Tim for your reply.
there is little different poor design issue here.
It can access more than 4 GB space, so memory address range is not an issue, but i am trying to allocate memory in a specific range which is i am keeping it for a specific device range, the other range is for other device and so on.

Thank you

xxxxx@yahoo.co.in wrote:

there is little different poor design issue here.
It can access more than 4 GB space, so memory address range is not an issue, but i am trying to allocate memory in a specific range which is i am keeping it for a specific device range, the other range is for other device and so on.

Your strategy doesn’t make any sense at all, and that leads me to wonder
if you have a misunderstanding. If you have multiple devices, then you
just allocate multiple buffers, and then tell each device the physical
addresses of its pages. The physical address range cannot possibly be
of any use. You do not get to dictate which physical addresses you get
(short of the below 4GB thing). Those pages might be assigned to some
other non-pageable purpose.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

hi Tim,
in case of storport miniport drivers, there is a routine available StorPortAllocateContiguousMemorySpecifyCacheNode() which allows user to choose the memory from range by providing the lowest and highest acceptable memory address. The same way, isn’t it possible to allocate memory from a range of physical address?
Thank you,
Hitesh

What you’re asking to do is very unusual. So, people who write drivers for a living are guessing that you MIGHT misunderstand something, and are trying to solve a problem the wrong way. In other words, instead of answering your SPECIFIC question, we’re trying to determine what larger problem you are trying to solve, and help you fix THAT.

This is common in this forum, as described here:
http:

But, if you must have a specific answer to your specific question: There’s MmAllocateContiguousMemorySpecifyCache

Peter
OSR
@OSRDrivers</http:>