What is the purpose of the 'WaitReason' parameter on KeWaitForSingleObject()?

767 Views Asked by At

The MSDN docs don't explain what happens for the various options here (despite being quite clear about the 'WaitMode' paramter). Why would I pick 'Executive' over 'UserRequest' or the myriad other options in KWAIT_REASON?

1

There are 1 best solutions below

1
On BEST ANSWER

My understanding is that this value is set into the invoking thread's _KTHREAD::WaitReason field, and that it there strictly for diagnostic purposes.

_KTHREAD::WaitReasonis consumed and displayed by various Windows diagnostic services.