diff options
author | kavsrf <kavsrf@gmail.com> | 2017-02-09 00:28:02 +0300 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-06-05 17:45:45 +0200 |
commit | 46cd09ef50bb63fa2b30b9c4f9fd284e130a46d4 (patch) | |
tree | 152e3767b8ae81a2dd6dc7e5e81e1411e02ce7e3 /src/Common/BootEncryption.cpp | |
parent | a075d45a99d31340c0de57262cd18eb717c3722a (diff) | |
download | VeraCrypt-46cd09ef50bb63fa2b30b9c4f9fd284e130a46d4.tar.gz VeraCrypt-46cd09ef50bb63fa2b30b9c4f9fd284e130a46d4.zip |
PlatformInfo read. (via ReadEfiConfig)
It is displayed in System settings
Diffstat (limited to 'src/Common/BootEncryption.cpp')
-rw-r--r-- | src/Common/BootEncryption.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index 45ba53d4..6dc2c979 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -372,7 +372,7 @@ namespace VeraCrypt } } - static void ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead) + static void ReadEfiConfig (const wchar_t *filename, byte* confContent, DWORD maxSize, DWORD* pcbRead) { Elevate(); @@ -382,8 +382,8 @@ namespace VeraCrypt SetLastError (ERROR_INVALID_PARAMETER); throw SystemException(SRC_POS); } - - DWORD result = ElevatedComInstance->ReadEfiConfig (&outputBstr, pcbRead); + BSTR bstrfn = W2BSTR(filename); + DWORD result = ElevatedComInstance->ReadEfiConfig (bstrfn, &outputBstr, pcbRead); if (confContent) memcpy (confContent, *(void **) &outputBstr, maxSize); @@ -492,7 +492,7 @@ namespace VeraCrypt static void BackupEfiSystemLoader () { throw ParameterIncorrect (SRC_POS); } static void RestoreEfiSystemLoader () { throw ParameterIncorrect (SRC_POS); } static void GetEfiBootDeviceNumber (PSTORAGE_DEVICE_NUMBER pSdn) { throw ParameterIncorrect (SRC_POS); } - static void ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead) { throw ParameterIncorrect (SRC_POS); } + static void ReadEfiConfig (const wchar_t *filename, byte* confContent, DWORD maxSize, DWORD* pcbRead) { throw ParameterIncorrect (SRC_POS); } static void WriteEfiBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg) { throw ParameterIncorrect (SRC_POS); } }; @@ -1530,14 +1530,14 @@ namespace VeraCrypt } } - void BootEncryption::ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead) + void BootEncryption::ReadEfiConfig (const wchar_t* fileName, byte* confContent, DWORD maxSize, DWORD* pcbRead) { if (!pcbRead) throw ParameterIncorrect (SRC_POS); if (!IsAdmin() && IsUacSupported()) { - Elevator::ReadEfiConfig (confContent, maxSize, pcbRead); + Elevator::ReadEfiConfig (fileName, confContent, maxSize, pcbRead); } else { @@ -1546,14 +1546,14 @@ namespace VeraCrypt finally_do ({ EfiBootInst.DismountBootPartition(); }); EfiBootInst.MountBootPartition(0); - EfiBootInst.GetFileSize(L"\\EFI\\VeraCrypt\\DcsProp", ui64Size); + EfiBootInst.GetFileSize(fileName, ui64Size); *pcbRead = (DWORD) ui64Size; if (*pcbRead > maxSize) throw ParameterIncorrect (SRC_POS); - EfiBootInst.ReadFile (L"\\EFI\\VeraCrypt\\DcsProp", confContent, *pcbRead); + EfiBootInst.ReadFile (fileName, confContent, *pcbRead); } } @@ -1575,7 +1575,7 @@ namespace VeraCrypt // call ReadEfiConfig only when needed since it requires elevation if (userConfig || customUserMessage || bootLoaderVersion) { - ReadEfiConfig (confContent, sizeof (confContent) - 1, &dwSize); + ReadEfiConfig (L"\\EFI\\VeraCrypt\\DcsProp", confContent, sizeof (confContent) - 1, &dwSize); confContent[dwSize] = 0; |