Re: Shared Memory Creation
- From: "Don Burn" <burn@xxxxxxxxxxxxxxxx>
- Date: Fri, 8 Sep 2006 08:21:03 -0400
And for an 8k area, it is probably a heck of a lot faster and safer not to
use shared memory at all. Use IOCTL's for the communication they are simple
and reliable, and plenty fast for this size of data.
If you use memory mapping, you are far from the norm. You have to worry
about how you are going to deal with the application failing (I have seen
drivers that hang because the application died), and a lot of pesky details
to get synchronization correct.
If you use IOCTL's with DIRECT_XXX access method the kernel will map the
pages of your buffer from user to kernel, there is not copying. If the
application fails, the IRP is canceled, so you get notification.
Bottom line there are few cases where having a shared memory region between
a driver and an application make sense, I have never seen one that was less
than megabytes.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
"Vladimir Zinin" <vzinin@xxxxxxxxx> wrote in message
news:%23uNUphy0GHA.3464@xxxxxxxxxxxxxxxxxxxxxxx
Mutex, events (see for ex. ZwCreateEvent).
But probably the IOCTL mechanism is more appropriate for your purposes...
--
Best regards,
Vladimir Zinin
mailto:vzinin@xxxxxxxxx
Chin wrote:
Hi Vladimir,
I manually added the proto in the header file. Its
working,
May I know further how to synchronise betn the appln and
driver as driver has to wait but appln is writing data continuously,
how will the appln know to to stop and proceed. Does having a flag in
shared memory help ?
Thanks and Regards,
Chin
.
- References:
- Shared Memory Creation
- From: Chin
- Re: Shared Memory Creation
- From: Vladimir Zinin
- Re: Shared Memory Creation
- From: Chin
- Re: Shared Memory Creation
- From: Vladimir Zinin
- Shared Memory Creation
- Prev by Date: Re: WinXPSP2, Intel Core2Duo, Kernel drivers
- Next by Date: Re: How to send URB and IRP to user mode application?
- Previous by thread: Re: Shared Memory Creation
- Next by thread: Re: Shared Memory Creation
- Index(es):
Relevant Pages
|