UMDF does not support a callback back into the calling process. The
pattern in UMDF is the same, you send the driver an IOCTL, the driver
pends it and is completed when the “event” occurs.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Friday, November 17, 2006 10:15 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Beginner - How to communicate to a UMDF driver from
my application?
Your driver and the application reside in separate address spaces, so
callbacks of this sort aren’t generally something to attempt. Not that
people don’t at least try to cheat that principle on occasion…
One way of accomplishing this is to have a “wait for input” IOCTL that
the app sends to the driver. The driver pends it until input is ready,
then completes it, perhaps with some details as to how much is available
(on an IOCTL you can define the input and output blocks, so this is
usually plenty of flexibility for this sort of a need). The serial
driver sample in the DDK/WDK uses this approach. Your app thread can
basically just synchronously send this, and do the I/O after it returns.
IN practice, you usually add some timeout and cancellation logic on both
ends of that, but I believe the sample shows a fine way to handle that.
Another is to signal this with a notification event. There is a DDK
sample (or used to be, anyway) that illustrates this. I’ve used this
approach along with a shared buffer mapped between the address spaces on
occasion, so it can be made to work.
But the IOCTL approach is easier to follow and maintain [and will raise
a lot fewer eyebrows], so I’d recommend it as the better way to do this.
I don’t believe UMDF directly supports user-mode only callbacks from the
UMDF driver to your app, but if they do, someone who knows more about it
than I do should say so.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer