!!! Somebody has an answer ? --> IoCreateNotificationEvent problem using it between ring0 and ring3

I am creating an event with IoCreateNotificationEvent with the name
L"\BaseNamedObjects\EventX" into my WDM driver at open time. After that
I
open the event into an MFC App by using OpenEvent(SYNCHRONIZE, FALSE,
“EventX”) and I wait on it. I then do a KePulseEvent into my driver and
everything works fine into my app (it unblocks). I then close my app
(without closing the event object), and the at that moment the event is
removed from \BaseNamedObjects directory. If I want to reopen it from my
app it is failing.

I tryed to open it twice into my driver (to simulate a increment refcount
of the event object) and it is not working.

The only workaround I found is to create the event at open time and to
delete it at close time if the refcount of the driver is 0. So I will be
recreated everytime someone open the driver.

Is this a bug ? Is there another better workaround ?

thanks


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

> I am creating an event with IoCreateNotificationEvent with the name

L"\BaseNamedObjects\EventX" into my WDM driver at open time. After that
I
open the event into an MFC App by using OpenEvent(SYNCHRONIZE, FALSE,
“EventX”) and I wait on it. I then do a KePulseEvent into my driver and
everything works fine into my app (it unblocks). I then close my app
(without closing the event object), and the at that moment the event is
removed from \BaseNamedObjects directory. If I want to reopen it from my
app it is failing.

I tryed to open it twice into my driver (to simulate a increment refcount
of the event object) and it is not working.

The only workaround I found is to create the event at open time and to
delete it at close time if the refcount of the driver is 0. So I will be
recreated everytime someone open the driver.

I never used this API. My guess is that HANDLE returned from the function
is only valid for the current process, and KEVENT’s reference counter is 0
and handle counter is 1. My guess is that it works for you because when you
access KEVENT the program is still running and the KEVENT is valid. To keep
it alive you need to use ObReferenceObject( KEVENT) to increment the
reference counter. Sorry, if I have gotten it wrong.


Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


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