Kernel event in windows 7

Hi, I’ve a simple driver that among others passes information about an interrupt to the application using a global named event. I know that it is not a perfect solution, but it worked until windows 7 came.

In the driver I create an event:

RtlInitUnicodeString(&str,“\BaseNamedObjects\MyEvent0”);
pevent=IoCreateSynchronizationEvent(&str, &ke->hevent);

When the interrupt comes, I schedule a DPC and set the event in it:

KeSetEvent(pevent, IO_NO_INCREMENT, FALSE);

Then in the application I open the event:

hEvent=OpenEvent(SYNCHRONIZE,FALSE,“Global\MyEvent0”);

And wait on it using:

WaitForSingleObject(hEvent,1000);

This works on XP and Vista, but the wait timeouts on win 7. Were there any changes in event signaling on win 7, where could be the problem?

Martin

You need to set a security descriptor when you create the event. Also, you need to use a GUID as part of the event name, to prevent the name collision with another not-so-wise driver or application.

Sounds like it would be easier to simply use an inverted call back and not a
named event.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: Thursday, July 15, 2010 1:38 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Kernel event in windows 7

You need to set a security descriptor when you create the event. Also, you
need to use a GUID as part of the event name, to prevent the name collision
with another not-so-wise driver or application.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

If you are really stuck on using an event, have the app create an unnamed event and send it down in an IOCTL. Use ObRefereneObjectByHandle to get the PKEVENT and you are good to go (and remember to deref the PKEVENT when the app closes).

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Thursday, July 15, 2010 11:58 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Kernel event in windows 7

Sounds like it would be easier to simply use an inverted call back and not a named event.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: Thursday, July 15, 2010 1:38 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Kernel event in windows 7

You need to set a security descriptor when you create the event. Also, you need to use a GUID as part of the event name, to prevent the name collision with another not-so-wise driver or application.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer