Skip to content

Commit

Permalink
Windows: Fix failed EFI detection on some PCs where BootOrder variabl…
Browse files Browse the repository at this point in the history
…e is not defined.

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

Proposed by @kriegste on #360
  • Loading branch information
idrassi committed Sep 16, 2024
1 parent 3a1c8ba commit eb0eec7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/BootEncryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eb0eec7

Please sign in to comment.