Roman
Roman

Reputation: 1447

How to enumerate all opened handles of specified process in kernel (Windows)

I have a kernel driver. How can i enumerate all opened handles of specified process in my kernel driver? I want to close these handles.

Thanks!

Upvotes: 1

Views: 3980

Answers (1)

Bukes
Bukes

Reputation: 3718

I want to close these handles.

For what it is worth, just because something can be done, doesn't mean it should be done. This is a bad idea.

That said, it's possible to enumerate all handles for all processes using an undocumented call to Zw/NtQuerySystemInformation with information class SystemHandleInformation. A web search using these terms will yield what you want.

Upvotes: 5

Related Questions