One PC has both Windows 7 and Windows 10 1703 installed (selectable by Windows 10's boot manager). In both, when running elevated as Administrator but not enabling SE_SYSTEM_ENVIRONMENT_NAME, MSDN's suggested attempt to call GetFirmwareEnvironmentVariable returns ERROR_INVALID_FUNCTION so I detect that the PC is BIOS-based.
(On that PC, Windows 10 repeatedly downloaded and failed to install newer versions of Windows 10 because of the display adapter, so I hid those updates.)
Some time after that, a Windows Update broke MSDN's code.
Yes the fix was to enable SE_SYSTEM_ENVIRONMENT_NAME. My program works now in Windows 7 (BIOS), Windows 10 1703 (BIOS), Windows 10 21H1 (BIOS), and Windows 10 21H1 (UEFI). I get ERROR_INVALID_FUNCTION on BIOS-based PCs. I didn't inspect what error is set in Windows 10 21H1 (UEFI) since the dummy firmware variable doesn't exist, but it wasn't ERROR_INVALID_FUNCTION so I detect that the PC is UEFI-based.
I still wonder why.