Windows Api determines whether the current system supports virtual technology

#include <windows.h>
#include <stdio.h>


int main()
{
if(IsProcessorFeaturePresent(PF_VIRT_FIRMWARE_ENABLED))
{
printf("Virtualization is present.\n");
}
else
{
printf("Virtualization not present.\n");
}


return 0;

}

According to https://technet.microsoft.com/en-US/library/ms724482

The document introduces PF_VIRT_FIRMWARE_ENABLED to indicate that Virtualization is enabled in the firmware. However, this macro cannot be seen in VS2008. The official Windows document indicates that the value is 21.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325591821&siteId=291194637