Imagine this:
-
You have user-mode code coded to talk to driver via IOCTL.
-
Driver group is late in delivering working driver code (not that this
happens)
-
User-mode group would like to do some preliminary testing?
-
Screwed!
-
You have user-mode code coded to use named event.
-
Driver group is late in delivering working driver code (not that this
happens)
-
User-mode group would like to do some preliminary testing?
-
Write some user-mode simulation code to perform activities on your
event code.
At least the user-mode group isn’t twiddling their thumbs waiting on
those late driver guys 
My point is this: it is architecturally better to couple modules as
loosely as possible. Relying on an IOCTL to a driver is far from loosely
coupled. Yes, there are times where this may be required ad we have all
written code we are not so proud of, but, you should strive for elegance
before relying on a hack.
Jamey
xxxxx@storagecraft.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary Little
Sent: Wednesday, October 17, 2001 11:26 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Way of notifyng the application of some event
Bill,
If you use IoCreateNoficationEvent to create a named event, and then use
OpenEvent to open a handle to the same named event you needn’t pass
anything between the user app and the driver via an IOCTL. It seems this
is much cleaner, though I still prefer blocking the app by marking an
IRP as PEND.
Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com
-----Original Message-----
From: Bill Christie [mailto:xxxxx@linkeng.com]
Sent: Wednesday, October 17, 2001 10:00 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Way of notifyng the application of some event
Sorry - I was less than thorough…
-
Create an event your user mode app using the CreateEvent() API.
-
Pass the handle of the event from step 1 to your driver via an IOCTL
call.
-
In your driver, call ObReferenceObjectByHandle(), passing it the
handle you obtained from step 2. You will get back a handle that you’ll
need for KeSetEvent().
-
In your driver, call KeSetEvent() using the handle obtained from step
- Note that KeSetEvent() must be generally be called at
<=IRQL_DISPATCH_LEVEL and in a nonarbitrary thread context. This means
that you will not be able to set your event in an interrupt service
routine (but you will be able to use it in your DPC). See the DDK docs
for details.
- Don’t forget to call ObDereferenceObject() when you’re done with the
event (e.g. when your driver or app shuts down).
Hope that helps.
-bill
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Ajitabh Prakash
Sent: Wednesday, October 17, 2001 11:52 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Way of notifyng the application of some event
how do you use it??
> -----Original Message-----
> From: Bill Christie [SMTP:xxxxx@linkeng.com]
> Sent: Wednesday, October 17, 2001 10:51 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Way of notifyng the application of
some event
>
> How about using KeSetEvent()?
> -bill
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Ajitabh Prakash
> > Sent: Wednesday, October 17, 2001 10:31 AM
> > To: NT Developers Interest List
> > Subject: [ntdev] Way of notifyng the application of some event
> >
> >
> > hi guys,
> > I am exploring the ways that a application can be
> > notified of a event in the driver. Can someone suggest me some
> > ways Other than polling the
> > driver using IOCTL.
> >
> >
> > thanks
> > ajitabh
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@linkeng.com
> > To unsubscribe send a blank email to
> > leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntdev as: xxxxx@ami.com To
> unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@linkeng.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@broadstor.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com