Geoff Chappell, Software Analyst
The HvlQueryHypervisorActiveProcessorCount function obtains a count of logical processors.
NTSTATUS HvlQueryActiveHypervisorProcessorCount (ULONG *LpCount);
The LpCount argument provides the address of a variable that is to receive the count of processors.
The function returns STATUS_SUCCESS if successful, else a negative error code.
The HvlQueryActiveHypervisorProcessorCount function is exported by name from the kernel in version 6.2 and higher.
The HvlQueryActiveHypervisorProcessorCount function is not documented. It is, however, declared in the NTOSP.H from the Windows Driver Kit (WDK) for Windows 10.
The function depends on the CPU Management feature of the hypervisor. If this is not enabled, the function fails, returning STATUS_UNSUCCESSFUL.
Except for this, the function stores its processor count at the given address, and returns STATUS_SUCCESS.