Does System.Diagnostic get its data by querying the WMI or by other means?
Is WMI querying the most basic way all these operations employ to get system information such as running processes, or are there even more direct methods?
Does System.Diagnostic get its data by querying the WMI or by other means? Is
Share
No, it doesn’t use WMI. It uses direct native API calls via internal classes within the System.Win32 namespace in mscorlib.dll and System.dll. Most classes like PerformanceCounter and EventLog just access the registry which uses native calls to advapi32.dll. Other functionality like getting a process list use calls in winnt.dll or kernel32.dll depending on the version of Windows. You can find more information about the native Win32 calls used here and more detailed information about performance counters here.
You can verify this using dotPeek or Reflector.NET and examining System.Diagnostics in mscorlib.dll and System.dll.