NdisSystemProcessorCount (NDIS 6.1) function
The NdisSystemProcessorCount function determines whether its caller is running on a uniprocessor or multiprocessor computer.
Syntax
CCHAR NdisSystemProcessorCount(void);
Parameters
This function has no parameters.
Return value
NdisSystemProcessorCount returns the maximum number of processors in the local computer.
Remarks
An NDIS driver can call the NdisSystemProcessorCount function to retrieve the maximum number of processors in the local computer. To retrieve the number of currently active processors, the driver must call the NdisSystemActiveProcessorCount function.
NdisSystemProcessorCount is similar to the KeQueryMaximumProcessorCount function.
Note In Windows Vista and earlier operating systems, NdisSystemProcessorCount returns the number of processors in the local computer. But in later operating systems, NdisSystemProcessorCount returns the maximum number of processors.
The value that NdisSystemProcessorCount returns does not change at runtime.
If your code uses an array of buffers, one buffer for each processor, you must decide whether to have a statically sized array based on NdisSystemProcessorCount or a dynamically sized array based on NdisSystemActiveProcessorCount.
To optimize your code based on the number of processors, you must use a resizable structure. In this case, use NdisSystemActiveProcessorCount.
If you are not optimizing and if the data structures that result from using the maximum processor count are relatively small, a resizable structure is not necessary. In this case, use NdisSystemProcessorCount to determine the size for a static array.
Requirements
Version |
See NdisSystemProcessorCount. |
Header |
Ndis.h (include Ndis.h) |
IRQL |
PASSIVE_LEVEL |
See also
NdisSystemActiveProcessorCount
Send comments about this topic to Microsoft
Build date: 7/17/2013