Question

I'm observing an program and want to kill it, if it is for some time in the state "wait:executive".

Here is a screenshot of the Process Explorer:

State: wait:executive

How can I get that state by code? Or could maybe tell me somebody what that state exactly mean? This will may help me to find the right query to solve my problem.

Was it helpful?

Solution

It is not state of program but it's state of thread.One process can have many threads.

You can call WaitForSingleObject to determine some states.

Also you can instantiate WMI using COM and selecting Win32_Thread class.

Here is some example.

More info here : How to determine that a win32 thread is either in Wait or Join or Sleep state in c++

OTHER TIPS

It means the thread is waiting for the scheduler/a component of the executive

It can be fetched with WMI Win32_Thread (or .net System.Diagnostics.ProcessThread WaitReason)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top