how application use Driver allocated memory space.

  • Thread starter Thread starter sulabh
  • Start date Start date
S

sulabh

Hello all,

i allocate memory in driver and pass the base address of this memory
into the application.
how the application map this memory in user space.

regards
suli
 
This is an incredibly bad idea. First unless you are extremely careful you
can open a major security hole. Second, you are looking at a ton of code
to handle detection of application exit, or else you are looking at a major
memory leak.

Instead have the application allocate the memory and pass it in via an
IOCTL. Note even then if you are sharing the memory between the
application and the driver, unless you are really good you are likely to
have a bigger overhead to synchronize these accesses than if you just used
regular calls. I have seen the shared data used correctly but 90% of the
time I found that I improved performance and reliability by pulling out
stuff like this.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
 
Back
Top