Determine if a lock is owned by the calling context.
Arguments
lock
Lock to test for ownership.
Return values
If the driver is compiled with DEBUG,
then LOCK_OWNED returns TRUE
if the current context owns the lock
and FALSE otherwise.
If the driver is not compiled with DEBUG,
then LOCK_OWNED returns TRUE in all cases.
Usage
The LOCK_OWNED function is designed to assist in the debugging of
driver code. Production versions of drivers should avoid calling this
function (via use of conditional compilation under DEBUG).
Warnings
The meaning of the calling context is specific to the implementation
of the operating system kernel. Depending upon the operating system
implementation, when LOCK_OWNED is called from an interrupt routine,
it may or may not return TRUE when that interrupt routine is not
holding the specified lock, but some underlying level
(base or interrupt level) is holding the lock.