Tech Support > Microsoft Windows > Drivers > Workaround for StreamClassCallAtNewPriority bug?
Workaround for StreamClassCallAtNewPriority bug?
Posted by Martin Harvey \(work\) on November 23rd, 2004


Hi folks,

I've had a bug in one of my drivers reported to me recently, and doing a bit
of

tracking down, it looks like StreamClassCallAtNewPriority is not working -
it'll

be fine for 99.9% of the time, and then it'll drop a request.

Basically, I schedule a timer, (StreamClassScheduleTimer), and in the timer

callback, I request the call at Low priority. During this process, I happen
to

set some flags via interlocked operations to make sure that I don't
re-entrantly

set the timer or the worker item.

After much checking, I found that in a long chain of calls (in the worker
item

f'n I set the timer again), eventually one ends up with the timer having
fired,

but the worker item still pending, (as debug in my CloseStream attests to).
I

then checked that this wasn't due to some stupidity on my part (race
conditions

or forgetting to use interlocked ops on the timer flags), and no, it isn't.

Seems like I'm not the only person to have found this either:

http://groups.google.co.uk/groups?q=...en&lr=&se lm=

eJ1n9.554%24mT.92542150%40news.nnrp.ca&rnum=3

or

http://tinyurl.com/462vr

Question is: What's the best workaround - I don't want to do any lengthy

processing at DPC level.

MH.



Posted by Martin Harvey \(work\) on November 25th, 2004



"Martin Harvey (work)" <m.harvey@nospam.snellwilcox.com> wrote in message
news:%23%23bFoIU0EHA.2200@TK2MSFTNGP09.phx.gbl...
Oh well - coded around it now. PsCreateSystemThread is your friend!

MH.




Similar Posts