1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: better workaround for cases where ERROR_INVALID_PARAMETER is returned during system encryption which is due to 4096-bytes alignment of disk.

This commit is contained in:
Mounir IDRASSI
2017-07-20 00:52:03 +02:00
parent fe26ed8a5d
commit 3021745f67
2 changed files with 108 additions and 35 deletions

View File

@@ -37,7 +37,7 @@ namespace VeraCrypt
{
public:
File () : Elevated (false), FileOpen (false), ReadOnly (false), FilePointerPosition(0), Handle(INVALID_HANDLE_VALUE), IsDevice(false), LastError(0) { }
File (wstring path,bool readOnly = false, bool create = false, bool useNormalAttributes = false);
File (wstring path,bool readOnly = false, bool create = false);
virtual ~File () { Close(); }
void CheckOpened (const char* srcPos) { if (!FileOpen) { SetLastError (LastError); throw SystemException (srcPos);} }
@@ -58,6 +58,7 @@ namespace VeraCrypt
bool IsDevice;
wstring Path;
DWORD LastError;
BYTE ReadBuffer[4096];
};