From 2722b465302626c2231f2d76e927bce3a9ccda4f Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 27 Oct 2019 01:39:37 +0200 Subject: Windows: code refactoring and convert NTSTATUS error code to WIN32 equivalent before displaying error message. --- src/Common/BootEncryption.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Common/BootEncryption.h') diff --git a/src/Common/BootEncryption.h b/src/Common/BootEncryption.h index 19ea372e..a94f1918 100644 --- a/src/Common/BootEncryption.h +++ b/src/Common/BootEncryption.h @@ -29,6 +29,10 @@ typedef NTSTATUS (WINAPI *NtQuerySystemInformationFn)( PULONG ReturnLength ); +typedef ULONG (WINAPI *RtlNtStatusToDosErrorFn)( + NTSTATUS Status +); + using namespace std; namespace VeraCrypt @@ -193,7 +197,7 @@ namespace VeraCrypt static BOOL IsPostExecFileField (const string& szFieldValue, wstring& filePath); }; - void GetVolumeESP(wstring& path); + void GetVolumeESP(wstring& path, wstring& bootVolumePath); std::string ReadESPFile (LPCWSTR szFilePath, bool bSkipUTF8BOM); void WriteESPFile (LPCWSTR szFilePath, LPBYTE pbData, DWORD dwDataLen, bool bAddUTF8BOM); @@ -221,7 +225,6 @@ namespace VeraCrypt BOOL UpdateConfig (const wchar_t* name, int pim, int hashAlgo, HWND hwndDlg); 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 () { if (bDeviceInfoValid) return &sdn; else { SetLastError (ERROR_INVALID_DRIVE); throw SystemException(SRC_POS);}} protected: @@ -231,7 +234,6 @@ namespace VeraCrypt PARTITION_INFORMATION_EX partInfo; bool bDeviceInfoValid; WCHAR tempBuf[1024]; - bool bBootVolumePathSelected; std::wstring BootVolumePath; }; -- cgit v1.2.3