|
static void PrintFwInfo(void)
{
DWORD VarSize = 0;
UINT8 SecureBoot = 0;
GetFirmwareEnvironmentVariableA("", "{00000000-0000-0000-0000-000000000000}", NULL, 0);
if (GetLastError() == ERROR_INVALID_FUNCTION)
printf("Firmware: Legacy BIOS\n");
else
{
printf("Firmware: UEFI\n");
VarSize = GetFirmwareEnvironmentVariableA("SecureBoot", GV_GUID, &SecureBoot, sizeof(uint8_t));
if (VarSize)
printf("Secure Boot: %s\n", SecureBoot ? "enabled" : "disabled");
else
printf("Secure Boot: unsupported\n");
}
}
Secure Boot结果好像有三种状态,enabled,disabled,unsupported,这几个关键词,是批处理需要捕捉的。
|
|