[Windbg tips] list all handle and view handle information

Source: Internet
Author: User

Windbg! The handle command allows you to conveniently debug the handle ).

 

View All handles in a process, Enter the command line

0: 014>! Handle
Handle 4
Type directory
Handle 8
Type Process
Handle C
Type key
Handle 10
Type Mutant
Handle 14
Type alpc Port
Handle 18
Type key
Handle 1c
Type event
Handle 20
Type key

... (Omitted)

 

Handle 7e0
Type Mutant
392 handles
Type count
None 17
Event 134
Section 47
File 35
Directory 3
Mutant 34
Windowstation 2
Semaphore 24
Key 47
Token 1
Process 3
Thread 27
Desktop 1
Iocompletion 4
Timer 5
Job 1
Keyedevent 1
Tpworkerfactory 6

From the windbg output results, we can see the types and values of all handles, and statistical information (a total of 392 handle, including 35 file handles and 47 registry handles ....).

 

 

If you wantView Details of a handle, You can run the following command:

 

0: 014>! Handle 0x5c8 F
Handle 5c8
Type key
Attributes 0
Grantedaccess 0x20019:
Readcontrol
Queryvalue, enumsubkey, Policy
Handlecount 2
Pointercount 3
Name/Registry/user/S-1-5-21-2127521184-1604012920-1887927527-2966534/software/Microsoft/Windows/CurrentVersion/Explorer/fileexts
Object specific information
Key last write time: 16:52:14. 5/20/2009
Key name fileexts

 

0x5c8 is the handle value. parameter F indicates that all information is displayed. We can see that the handle 0x5c8 is the Registry handle, path is/Registry/user/S-1-5-21-2127521184-1604012920-1887927527-2966534/software/Microsoft/Windows/CurrentVersion/Explorer/fileexts.

 

 

It is worth mentioning that windbg also provides! HtraceCommand, you can easily use the handle leak to check handle leakage. Next time, I will write a blog to introduce it.! Htrace.

 

 

> Original article copyright belongs to the author, reprint please indicate the source (http://blog.csdn.net/WinGeek/), thank you. <

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.