Callers of KeWaitForSingleObject must be running at IRQL <= DISPATCH_LEVEL. However, if Timeout <> 0, the caller must be running at IRQL <= APC_LEVEL and in a nonarbitrary thread context.
在MSDN中这样写道:
KeWaitForSingleObject must be running at IRQL <= DISPATCH_LEVEL.
Usually, the caller must be running at IRQL = PASSIVE_LEVEL and in a nonarbitrary thread context.
A call while running at IRQL = DISPATCH_LEVEL is valid if and only if the caller specifies a Timeout of zero.
That is, a driver must not wait for a nonzero interval at IRQL = DISPATCH_LEVEL.