Tools: VS 2008 and windbg 6.12.2.633
Step: 1. Bind the deadlock process to windbg first. Use it! The locks command displays the thread's lock usage information.
2. After windbg uses. Detach, bind the stack to vs 2008 to view the thread and locate the code.
0: 040>! Locks
Critsec + 1799ee4 at 01799ee4
Waiterwoken No
Lockcount 0
Recursioncount 1
Owningthread 1230
Entrycount 0
Contentioncount 0
* ** Locked
Critsec + 179a29c at 0179a29c
Waiterwoken No
Lockcount 0
Recursioncount 1
Owningthread 1230
Entrycount 0
Contentioncount 0
* ** Locked
Critsec + 18339f8 at 018339f8
Waiterwoken No
Lockcount 0
Recursioncount 1
Owningthread 5c0
Entrycount 0
Contentioncount 1
* ** Locked
Critsec + 15e746c at 015e746c
Waiterwoken No
Lockcount 0
Recursioncount 1
Owningthread 1230
Entrycount 0
Contentioncount 0
* ** Locked
Critsec + 72d43fc at 072d43fc
Waiterwoken No
Lockcount 1
Recursioncount 1
Owningthread 5c0
Entrycount 0
Contentioncount 3B
Reference link: http://bbs.pediy.com/showthread.php? T = 24077