Re: Example using PHYSICAL_ADDRESS



joemango <joseandremorales@xxxxxxxxx> wrote:

Im writing a kernel process and i want to call the following
function:

PVOID
MmAllocateContiguousMemory(
IN SIZE_T NumberOfBytes,
IN PHYSICAL_ADDRESS HighestAcceptableAddress
);

But i dont know how to use the PHYSICAL_ADDRESS parameter, ive tried
initializing a variable of that type / struct,

You can't be serious.

PHYSICAL_ADDRESS pa;
pa.QuadPart = 0x3ffffffffULL; // just under 16GB

PVOID pv = MmAllocateContiguousMemory( 16384, pa );

Or even:

PHYSICAL_ADDRESS pa = { 0x3, 0xffffffff };
PVOID pv = MmAllocateContiguousMemory( 16384, pa );

ive looked on the net,
i dont find any working examples that show a call to it, so i need a
small sample that has , the necessary include files, how to create a
variable of that type give it a value and then make the call, can you
all help with this ????

You'll get the structure declaration when you include <ntddk.h> or <wdm.h>.
You are writing a driver, right?
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.


Loading