Export (0) Print
Expand All
Expand Minimize

KeNumberProcessors

The KeNumberProcessors kernel variable is obsolete in Windows Vista with Service Pack 1 (SP1), Windows Server 2008, and later versions of Windows. KeNumberProcessors does not appear in WDK headers for WDK releases starting with Windows Vista SP1; however, the variable is still exported from the kernel, so drivers built for earlier platforms will not break.

Windows Server 2008 includes support for Dynamic Hardware Partitioning (DHP) in the Windows Datacenter and Enterprise Edition SKUs. As part of DHP, Windows Server 2008 supports hot adding CPUs at runtime. In a hot-add CPU environment, the number of processors may not remain constant during runtime.

Accordingly, in Windows Server 2008, code that can determine the number of processors must use KeQueryActiveProcessors instead of direct references to the kernel variable, KeNumberProcessors.

Review any code that currently references KeNumberProcessors to make sure that it accommodates changes to CPU count in hot-add CPU environments.

You can use the PNPCPU tool to simulate hot adding a CPU for testing purposes.


#if (NTDDI_VERSION >= NTDDI_VISTA)
extern NTSYSAPI volatile CCHAR KeNumberProcessors;
#else
#if (NTDDI_VERSION >= NTDDI_WINXP)
extern NTSYSAPI CCHAR KeNumberProcessors;
#else
extern PCCHAR KeNumberProcessors;
#endif
#endif

Starting with Windows XP, KeNumberProcessors is an 8-bit integer value that indicates the number of processors in the platform. In earlier versions of Windows, KeNumberProcessors is a pointer to an 8-bit integer value that indicates the number of processors in the platform.

Requirements

Version

Obsolete in Windows Vista with SP1, Windows Server 2008, and later versions of Windows.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

See also

KeQueryActiveProcessors

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft