AceInfinity
Emeritus, Contributor
There's a simple function provided within kernel32.dll which will tell you whether you've booted up through UEFI mode or whether the firmware is still using the legacy BIOS mode.
I've written an example implementation for anyone curious:
:thumbsup2:
I've written an example implementation for anyone curious:
Code:
#include <Windows.h>
#include <stdio.h>
typedef BOOL (WINAPI *pGetFirmwareType)(PFIRMWARE_TYPE);
int main(void)
{
FIRMWARE_TYPE firmware;
pGetFirmwareType fpGetFirmwareType = GetProcAddress(GetModuleHandle("kernel32.dll"), "GetFirmwareType");
if (fpGetFirmwareType && fpGetFirmwareType(&firmware))
{
switch (firmware)
{
case FirmwareTypeUnknown:
puts("Firmware type unknown");
break;
case FirmwareTypeBios:
puts("Legacy BIOS mode");
break;
case FirmwareTypeUefi:
puts("UEFI mode");
break;
case FirmwareTypeMax:
puts("Not implemented");
break;
}
}
return 0;
}
:thumbsup2: