发布网友 发布时间:2024-10-24 00:02
共2个回答
热心网友 时间:9分钟前
//1, 支持efi引导的//只有win7及以上, 所以xp, 03系统就只能够bios引导
//2, win7,8,8.1,10等系统, 可以用下面的代码, 本质上就是GetFirmwareEnvironmentVariableA, 或者GetFirmwareType这两个api的调用
#include <Windows.h>
#include <Winbase.h> //GetFirmwareEnvironmentVariableA 和 GetFirmwareType的头文件
#include <iostream>
using namespace std;
void main()
{
//For Windows 8/Server 2012 and above可用
/*
typedef enum _FIRMWARE_TYPE {
FirmwareTypeUnknown = 0,
FirmwareTypeBios = 1,
FirmwareTypeUefi = 2,
FirmwareTypeMax = 3
} FIRMWARE_TYPE, *PFIRMWARE_TYPE;
*/
FIRMWARE_TYPE a;
GetFirmwareType(&a);
switch (a)
{
case FirmwareTypeUnknown:
cout << "不知名引导" << endl; break;
case FirmwareTypeBios:
cout << "Bios引导" << endl; break;
case FirmwareTypeUefi:
cout << "Uefi引导" << endl; break;
case FirmwareTypeMax:
cout << "Not implemented" << endl; break;
}
//Windows 7/Server 2008R2 and above可用
GetFirmwareEnvironmentVariableA("", "{00000000-0000-0000-0000-000000000000}", NULL, 0);
if (GetLastError() == ERROR_INVALID_FUNCTION)
//API not supported; this is a legacy BIOS
cout << "Bios引导" << endl;
else
//API error (expected) but call is supported.This is UEFI.
cout << "Uefi引导" << endl;
system("pause");
}
热心网友 时间:3分钟前
使用dism++可以直接看出来