Hi
A) InStackQueued Spinlocks
WDK says
“The driver allocates a KLOCK_QUEUE_HANDLE structure that it passes by pointer to KeAcquireInStackQueuedSpinLock. The driver passes the same structure by pointer to KeReleaseInStackQueuedSpinLock when it releases the spin lock.
****Drivers should normally allocate the structure on the stack each time they acquire the lock.****”
- Why do KLOCK_QUEUE_HANDLE need to be on stack? Can I have just have it on NPAGED heap?
- Is it just not advised to have that elsewhere other than stack or just illegal . I guess it will be the former, but just want to confirm?
- Also can I acquire the InStackQueued lock in one thread and release it on a different thread?
B) Threaded DPC
WDK Says
" ***On server systems, where overall system performance is more important than system latency, threaded DPCs work in the identical manner as ordinary DPCs do***.
It is only on client systems, where a high system latency causes the system to appear unresponsive, that threaded DPCs can be preempted by real-time threads."
- But on 2K8 Server my threaded DPC gets called both at passive and dispatch levels. What did I miss here, Does OS not enforce that? If so why include that text in the WDK verbatim?
–thx