mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: compatibility with multi-OS boot configuration by only setting VeraCrypt as first bootloader of the system if the current first bootloader is Windows one.
This commit is contained in:
@@ -12685,19 +12685,16 @@ void CheckFilesystem (HWND hwndDlg, int driveNo, BOOL fixErrors)
|
||||
ShellExecuteW (NULL, (!IsAdmin() && IsUacSupported()) ? L"runas" : L"open", cmdPath, param, NULL, SW_SHOW);
|
||||
}
|
||||
|
||||
|
||||
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str)
|
||||
BOOL BufferContainsPattern (const byte *buffer, size_t bufferSize, const byte *pattern, size_t patternSize)
|
||||
{
|
||||
size_t strLen = strlen (str);
|
||||
|
||||
if (bufferSize < strLen)
|
||||
if (bufferSize < patternSize)
|
||||
return FALSE;
|
||||
|
||||
bufferSize -= strLen;
|
||||
bufferSize -= patternSize;
|
||||
|
||||
for (size_t i = 0; i < bufferSize; ++i)
|
||||
{
|
||||
if (memcmp (buffer + i, str, strLen) == 0)
|
||||
if (memcmp (buffer + i, pattern, patternSize) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -12705,6 +12702,17 @@ BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *st
|
||||
}
|
||||
|
||||
|
||||
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str)
|
||||
{
|
||||
return BufferContainsPattern (buffer, bufferSize, (const byte*) str, strlen (str));
|
||||
}
|
||||
|
||||
BOOL BufferContainsWideString (const byte *buffer, size_t bufferSize, const wchar_t *str)
|
||||
{
|
||||
return BufferContainsPattern (buffer, bufferSize, (const byte*) str, 2 * wcslen (str));
|
||||
}
|
||||
|
||||
|
||||
#ifndef SETUP
|
||||
|
||||
int AskNonSysInPlaceEncryptionResume (HWND hwndDlg, BOOL *pbDecrypt)
|
||||
|
||||
Reference in New Issue
Block a user