1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Fix failed EFI detection on some PCs where BootOrder variable is not defined.

we now report that EFI is not support only when GetFirmwareEnvironmentVariable fails with error ERROR_INVALID_FUNCTION.

Proposed by @kriegste on https://github.com/veracrypt/VeraCrypt/issues/360
This commit is contained in:
Mounir IDRASSI
2024-09-16 23:11:37 +02:00
parent 3a1c8bac59
commit eb0eec7b39

View File

@@ -2636,7 +2636,7 @@ namespace VeraCrypt
bool EfiBoot::IsEfiBoot() {
DWORD BootOrderLen;
BootOrderLen = GetFirmwareEnvironmentVariable(L"BootOrder", EfiVarGuid, tempBuf, sizeof(tempBuf));
return BootOrderLen != 0;
return (BootOrderLen != 0) || (GetLastError() != ERROR_INVALID_FUNCTION);
}
void EfiBoot::DeleteStartExec(uint16 statrtOrderNum, wchar_t* type) {