The !locks extension in Ntsdexts.dll displays a list of critical sections associated with the current process.
This extension command should not be confused with the !kdext*.locks extension command.
Specifies the amount of information to be displayed. Any combination of the following options can be used:
Causes the display to include all critical sections, even those that are not currently owned.
(Windows XP and later) Causes the display to only include orphaned information (pointers that do not actually point to valid critical sections).
Windows XP and later
For other commands and extensions that can display critical section information, see Displaying a Critical Section. For information about critical sections, see the Microsoft Windows SDK documentation, the Windows Driver Kit (WDK) documentation, and Microsoft Windows Internals by Mark Russinovich and David Solomon.
This extension command shows all critical sections that have been initialized by calling RtlInitializeCriticalSection. If there are no critical sections, then no output will result.
Here is an example:
0:000> !locks CritSec w3svc!g_pWamDictator+a0 at 68C2C298 LockCount 0 RecursionCount 1 OwningThread d1 EntryCount 1 ContentionCount 0 *** Locked CritSec SMTPSVC+66a30 at 67906A30 LockCount 0 RecursionCount 1 OwningThread d0 EntryCount 1 ContentionCount 0 *** Locked