RE: Signalling event problem in WDM Driver between DPC an d system thread

Make your event autoreset (specify SynchronizationEvent to
KeInitializeEvent,) and stop calling KeResetEvent.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: sagaya cyril [mailto:xxxxx@hotmail.com]
Sent: Tuesday, July 22, 2003 12:44 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Signalling event problem in WDM Driver between DPC and
system thread

Hi All,

I am trying to synchronize one system thread and a DPC as signalled from
DPC.

Description:

In a thread (created by PsCreateSystemThread) we are waiting for an event as
follows :
Fn1()
{
While(1)
{
KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL); /*Blocking
call */
KeResetEvent(&Event);
/* Our code */
}
}

In DPC we raise event by calling :

Fn2()
{
KeSetEvent(&Event,IO_NO_INCREMENT,FALSE);
}

The DPC is scheduled for every few milliseconds. Fn2 and Fn1 executes
alternative for few seconds after which the thread of Fn1() is not being
scheduled alternatively as expected and starts after Fn2() has got executed
for few times.

Could anybody suggest me the reason for this misbehavior? If possible any
solution would be very much appreciated.

Regards,
Cyril

They are beautiful. They are in danger. Our four-legged friends. —
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com