KeGetCurrentProcessorNumber

ULONG
    KeGetCurrentProcessorNumber(

    );

KeGetCurrentProcessorNumber returns the system-assigned number of the current processor on which the caller is running.

Comments

KeGetCurrentProcessorNumber can be called by drivers to debug spin lock usage on SMP machines during driver development.

The number of processors in an SMP machine is a zero-based value.

If the call to KeGetCurrentProcessorNumber occurs at IRQL < DISPATCH_LEVEL, a processor switch can occur between instructions. Consequently, callers of KeGetCurrentProcessorNumber usually run at IRQL >= DISPATCH_LEVEL.