Virtual address of buffer .

Hi,

I have successfully allocated a page using MmAllocatePagesForMdl() & could get user address by mapping this buffer.
But, I am unable to obtain the virtual address / physical address of the buffer.

I tried using MmGetMdlVirtualAddress / by accessing MDL members directly.But,always it returned address as 0.
Can anybody help me in obtaining Virtual & Physical address of the allocated page ?

Thanks in advance,
Sundeep

Why do you need the physical address? The only legitimate use for it is DMA, and for DMA, you must use the OS’s DMA facilities like ->MapTransfer.
You already have the virtual address. The user one. To have the kernel one, call MmGetSystemAddressForMdlSafe.

Max

----- Original Message -----
From: Sundeep Kajale
To: NT Developers Interest List
Sent: Monday, April 08, 2002 5:28 PM
Subject: [ntdev] Virtual address of buffer .

Hi,

I have successfully allocated a page using MmAllocatePagesForMdl() & could get user address by mapping this buffer.
But, I am unable to obtain the virtual address / physical address of the buffer.

I tried using MmGetMdlVirtualAddress / by accessing MDL members directly.But,always it returned address as 0.
Can anybody help me in obtaining Virtual & Physical address of the allocated page ?

Thanks in advance,
Sundeep

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

Hi Max,

Thanks for your help.
Why do you need the physical address? The only legitimate use for it is DMA, and for DMA, you must use the OS’s DMA facilities like ->MapTransfer.
You already have the virtual address. The user one. To have the kernel one, call MmGetSystemAddressForMdlSafe.

Max

> I want to use DMA on my card.Hence, I require Physical address.My driver will be monitoring data on this page as well as I want my application to use the same data.So, I require user address & virtual address ( kernel one ) for the page.
I used MmGetSystemAddressForMdlSafe after MmAllocatePagesForMdl(). But, system hangs with this option & all other options except mmGetMdlVirtualAddress which returns 0 always. Is there any other alternative or I am missing something?

Thanks,
Sundeep