From: Olivier on
Good news,

I succeeded in recovering physical addresses that are behind a DirectX
surface, and to safely and efficiently DMA-transfer the surface to my
hardware.

FYI, the procedure is :
1) MmProbeAndLockPages on the MDL
2) MmGetSystemAddressForMdlSafe to recover system virtual address
3) MmGetMdlByteCount to recover buffer bytes count
4) ADDRESS_AND_SIZE_TO_SPAN_PAGES and MmGetMdlPfnArray to recover physical
pages (and thus physical addresses since pages are locked) behind the buffer
5) MmGetMdlByteOffset to recover buffer offset within first physical page
6) DMA-transfer each page to the device using proprietary means
7) MmUnlockPages

I know this far from the standard and recommended way of doing such, but
this is ok for me as developping for a very custom solution with dedicated
hardware, not for a consumer product being installed and operated on any
platform.

Thanks everyone for your help, and best regards.

Olivier
From: Alexander Grigoriev on
Why don't you get a scatter gather list instead of accessing PFN? Tell
IoGetDmaAdapter that you support SG.

"Olivier" <o.antoine(a)discussions.microsoft.com> wrote in message
news:4B084060-5621-40AA-AAC3-533AA51B1C4F(a)microsoft.com...
> Good news,
>
> I succeeded in recovering physical addresses that are behind a DirectX
> surface, and to safely and efficiently DMA-transfer the surface to my
> hardware.
>
> FYI, the procedure is :
> 1) MmProbeAndLockPages on the MDL
> 2) MmGetSystemAddressForMdlSafe to recover system virtual address
> 3) MmGetMdlByteCount to recover buffer bytes count
> 4) ADDRESS_AND_SIZE_TO_SPAN_PAGES and MmGetMdlPfnArray to recover physical
> pages (and thus physical addresses since pages are locked) behind the
> buffer
> 5) MmGetMdlByteOffset to recover buffer offset within first physical page
> 6) DMA-transfer each page to the device using proprietary means
> 7) MmUnlockPages
>
> I know this far from the standard and recommended way of doing such, but
> this is ok for me as developping for a very custom solution with dedicated
> hardware, not for a consumer product being installed and operated on any
> platform.
>
> Thanks everyone for your help, and best regards.
>
> Olivier