|
|
|
date: Mon, 7 Apr 2008 14:57:23 +0800,
group: microsoft.public.win32.programmer.wmi
back
RE: File Handle Count of each Process
Hi Akash,
This WMI counter is the handle count of the process, including File Handle,
Desktop Handle, Process Handle etc.... Also, in Windows NT not only files
which reside on disk are represented by a file object. File objects are
also used to access communication devices, input/output devices and so on.
I do not believe there is any user-mode public documented interface to
query specific File Handle count. As I know, most of the tools(such as
Sysinternals Process Explorer) use a driver to get process handle table
information. The article below contains the similar approach:
"FileObjectInfo - Digging into the Windows NT Internals"
http://www.codeguru.com/cpp/w-p/files/fileinformation/article.php/c4453/
There are undocumented user-mode native APIs can get this type of
information, but Microsoft official does not support undocumented native
APIs.
For example, you can use ZwQuerySystemInformation API to get
SystemHandleInformation type of information. The ObjectTypeNumber field
contains the object type number which you can use use ZwQueryObject API to
translate into type name. You can filter other types and only count the
File handle type. If you really wanted to use this approach, I recommend
you to get the book <Windows NT/2000 Native API Reference> which contains
the detailed description of native APIs. It also contains a sample code
snippet "Example 1.2: Listing Open Handles of a Process"
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Tue, 08 Apr 2008 05:03:16 GMT
author: (Jeffrey Tan[MSFT])
|
|