Hello all,
My driver create a named event call L"\baseNamedObjects\IKEEVENT" using IoCreateNotificationEvent successfully. My application open event using OpenEvent success.But when i restart my application ,OpenEvent fails.why???
Because the event went away when your application closed. Named events only survive until the last handle to them is closed. If you create a named event in the context of a user-mode process, even if you are creating it in a kernel mode driver, then when that process goes away, all handles to the event will automagically be closed and the event will go away. Somebody needs to write a KB on this if they haven’t already, (I haven’t checked honestly). Anyway, the named event approach is the last I would use. There are other problems like non-administrator accounts failing OpenEvent and such. Its just a mess.
You would be much better off creating an event in your app, and passing this event into your driver. See this for more:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q228785
Particularily, look at the event example app and driver. Good luck.
–
Bill McKenzie
“square” <square_79> wrote in message news:xxxxx@ntdev…
Hello all,
My driver create a named event call L"\baseNamedObjects\IKEEVENT" using IoCreateNotificationEvent successfully. My application open event using OpenEvent success.But when i restart my application ,OpenEvent fails.why???</square_79>
>automagically be closed and the event will go away. Somebody needs to write a KB on this if they haven’t
already, (I haven’t checked honestly). Anyway, the named event approach is the last I would use. There are
There was a KB article which un-recommend this technique at all.
Create an unnamed event in the app and pass it to the driver in IOCTL input buffer.
Max