On 2019-03-29 19:20, Derek Lesho wrote:
On Fri, Mar 29, 2019 at 7:57 AM Thomas Faber thomas.faber@reactos.org wrote:
This may not be important for now, but this function will also return true if the current IRQL is APC_LEVEL or higher. So perhaps "|| KeGetCurrentIrql() > 0" or a FIXME could make sense.
I thought about doing this, and I have another patch in the pipeline that adds some basic IRQL stuff, but the MSDN page for this functions says "The KeAreApcsDisabled routine returns whether the calling thread is within a critical region or a guarded region, which disables normal kernel APC delivery.", so it sounds like they check whether you are in a region, not the IRQL level. Or maybe that's just bad documentation?
You're right, my apologies. I checked my test[1] and KeAreApcsDisabled indeed ignores the IRQL. It's KeAreAllApcsDisabled that will return TRUE if you're at APC_LEVEL. So your patch is obviously fine in this regard!
[1] https://github.com/reactos/reactos/blob/master/modules/rostests/kmtests/ntos...