Re: Can I call KeAcquireSpinLockAtDpcLevel at DISPATCH_LEVEL?



So, if I understand correctly, there is nothing wrong in acquiring a
SpinLock in a DPC (as long as I observe the rules of 25 microseconds,
not aquiring it twice, etc.). Right?

Yes.

One issue that keeps confusing me is: what happens if for some reason
a spinlock is not released in a timely manner (i.e. 250 microseconds
instead of 25 microseconds)? Will the system crash (due to missing

I think the time limit is imposed only by checked build and is much larger -
10ms or so.

Nevertheless, you should make your code paths holding a spinlock as short as
possible, this is a coding culture issue.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com

.