Mapping Kernal Mode address to user mode.

Hi All,

I am writing a WDM driver and wanted to know that is there a possible way that the driver can allocate a kernal mode memory [may be contigious] for DMA purpose and the application can access the buffer directly.

I know the way to do it is to allocate in user mode and map it to the kernal mode. But my hardware has a way of giving me the data which is originated from hardware and because of that I was wondering that if some way I could push the data to application without blocking a call from application and without a memcpy.

Any help is highly appriciated.

  • Ajitabh.

Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.

> I am writing a WDM driver and wanted to know that is there a
possible

way that the driver can allocate a kernal mode memory [may be contigious] for
DMA purpose and the application can access the buffer directly.

Major misdesign and security violation, you expose some possibly sensitive
kernel data to the user.

I know the way to do it is to allocate in user mode and map it to
the kernal
mode. But my hardware has a way of giving me the data which is originated
from hardware and because of that I was wondering that if some way I could
push the data to application without blocking a call from application

Why blocking? Open an overlapped file and send a lot of overlapped IO requests.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Unless you really have high performance needs, trying to map the memory is a
bad idea. You are going to have security problems, and you have to figure
ways of detecting if the application has exited, etc. If you really need
it, one old example of how is at http://www.eclectic-eng.com/download.htm
look at the memorymap.zip file.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“Driver Coder” wrote in message news:xxxxx@ntdev…
> Hi All,
>
> I am writing a WDM driver and wanted to know that is there a
> possible way that the driver can allocate a kernal mode memory [may be
> contigious] for DMA purpose and the application can access the buffer
> directly.
>
> I know the way to do it is to allocate in user mode and map it to
> the kernal mode. But my hardware has a way of giving me the data which is
> originated from hardware and because of that I was wondering that if some
> way I could push the data to application without blocking a call from
> application and without a memcpy.
>
>
> Any help is highly appriciated.
> - Ajitabh.
>
>
> ---------------------------------
> Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo!
> Messenger with Voice.