From 89e2547851e258271f32bbb750f88a2953859cd3 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 27 Oct 2019 00:09:44 +0200 Subject: Windows: Make EFI System Encryption PostOOBE code more robust to failure to access "\\\\?\\GLOBALROOT" disk namespace --- src/Common/BootEncryption.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Common/BootEncryption.h') diff --git a/src/Common/BootEncryption.h b/src/Common/BootEncryption.h index ec54b3ab..19ea372e 100644 --- a/src/Common/BootEncryption.h +++ b/src/Common/BootEncryption.h @@ -201,7 +201,7 @@ namespace VeraCrypt public: EfiBoot(); - void PrepareBootPartition(); + void PrepareBootPartition(bool bDisableException = false); bool IsEfiBoot(); void DeleteStartExec(uint16 statrtOrderNum = 0xDC5B, wchar_t* type = NULL); @@ -222,13 +222,14 @@ namespace VeraCrypt BOOL WriteConfig (const wchar_t* name, bool preserveUserConfig, int pim, int hashAlgo, const char* passPromptMsg, HWND hwndDlg); BOOL DelDir(const wchar_t* name); void SelectBootVolumeESP(); - PSTORAGE_DEVICE_NUMBER GetStorageDeviceNumber () { return &sdn;} + PSTORAGE_DEVICE_NUMBER GetStorageDeviceNumber () { if (bDeviceInfoValid) return &sdn; else { SetLastError (ERROR_INVALID_DRIVE); throw SystemException(SRC_POS);}} protected: bool m_bMounted; std::wstring EfiBootPartPath; STORAGE_DEVICE_NUMBER sdn; PARTITION_INFORMATION_EX partInfo; + bool bDeviceInfoValid; WCHAR tempBuf[1024]; bool bBootVolumePathSelected; std::wstring BootVolumePath; -- cgit v1.2.3