KeAcquireSpinLock() MAY be called at DISPATCH_LEVEL, it is not necessary
to be below. It may NOT be called from above DISPATCH_LEVEL.
Assuming you’ve done things right up until that point, if you are
holding a spin lock, you are at DISPATCH_LEVEL, so KeReleaseSpinLock()
can be called only at DISPATCH_LEVEL, and not below.
If you are at DISPATCH_LEVEL prior to acquiring a spin lock, then
KeAcquire/ReleaseSpinLock() are doing additional unnecessary work. The
routines KeAcquire/ReleaseSpinLockAt/FromDpcLevel() are offered for
optimization – they cut out the unnecessary steps of changing the IRQL.
Dave Cox
Hewlett-Packard Co.
HPSO/SSMO (Santa Barbara)
https://ecardfile.com/id/Dave+Cox
-----Original Message-----
From: Neelay Das [mailto:xxxxx@netlab.hcltech.com]
Sent: Thursday, April 20, 2000 5:46 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Blue screen
Hi,
The problem is that you can call the KeAcquireSpinLock() and
KeReleaseSpinLock() only at IRQLs less than dispatch level since in the
process of acquiring the lock first the IRQL is raised to dispatch level
from the old IRQL and then the lock is acquired. Since in your DPC routine
you’ll already be runing at dispatch level IRQL you should use the routines
KeAcquireSpinLockAtDpcLevel() and KeReleaseSpinLockFromDpcLevel() to
respectively acquire and release spin locks from your DPC routines. Hope
this is of some help.
Thanks,
-Neelay
“Fareeduddin A. Mohammed” wrote:
Hi All.,
I am getting a blue screen with the following message:
A wait operation, attach process, or yield was attempted from a DPC
routine. with bugcheck code as 0x000000b8 and all four parameters as 0.
Any idea about it? I do have a DPC routine and I am calling
KeStallExecutionProcessor(50L) and also KeAcquireSpinLock() and
KeReleaseSpinLock() functions in that routine.
Please help!
Thanks in advance.
-Fareed.
You are currently subscribed to ntdev as: david_cox2@hp.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)