Does WMI use a polling technique?
Is there anyway to "hook" the CreateProcess call?
Is there anyway to get an event when a performance counter changes value?
> I suppose that you could use the System.Diagnostics.PerformanceCounter class
> to monitor the Process counter and poll the processes that are there every
[quoted text clipped - 14 lines]
> > Is there any way to do this without going through the "overhead" of WMI?
> > Can this be gotten by using the System.Diagnostics.Performance... classes?
Mitch Ruebush - 26 Feb 2004 22:33 GMT
I see if anybody else knows of a better way, but WMI is not all that slow
and that is the only way that I know to register for events. These are
accessed through a System.Management.WQLEventQuery that is associated with a
System.Management.ManagementEventWatcher
Counters are just values, very lightweight, WMI is the infrastructure that
does what you are asking, creating the ability to attach events to the
counters.
You could write your own process factory and make you own event for creating
processes and then launch the Process using the System.Diagnostics.Process
object, but that would only work on your program's processes.
Otherwise Windows launches the processes and I don't think there is an event
in the Win32 api, I will look later though...
The examples I have seen all use some kind of polling to do this (for
example creating a simple Task Manager and being able to update the process
list, this is done on threads).
Mitch
> Does WMI use a polling technique?
> Is there anyway to "hook" the CreateProcess call?
[quoted text clipped - 22 lines]
> > > Can this be gotten by using the System.Diagnostics.Performance...
> classes?
Willy Denoyette [MVP] - 27 Feb 2004 20:18 GMT
The "WMI Kernel Trace Event Provider" (XP and higher) is a high performance
provider exposing Win32_ProcessStartTrace, Win32_ProcessStopTrace,
Win32_ThreaStartTrace, Win32_ThreadStopTrace events is superfast and
provides a new scope for monitoring process related resources.
Willy.
> Does WMI use a polling technique?
> Is there anyway to "hook" the CreateProcess call?
[quoted text clipped - 24 lines]
>> > Can this be gotten by using the System.Diagnostics.Performance...
> classes?