mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-30 23:13:31 +01:00
Windows MBR Bootloader: workaround for issue affecting creation of hidden OS on some SSD drives (Error 128 while writing MBR). This commit replace the 512 bytes write operations by a 4096 bytes write operation.
This commit is contained in:
parent
7ef3d5e369
commit
6abc59acd2
@ -85,14 +85,29 @@ void ReadBootSectorUserConfiguration ()
|
||||
|
||||
BiosResult UpdateBootSectorConfiguration (byte drive)
|
||||
{
|
||||
AcquireSectorBuffer();
|
||||
uint64 mbrSector;
|
||||
mbrSector.HighPart = 0;
|
||||
mbrSector.LowPart = 0;
|
||||
|
||||
AcquireSectorBuffer();
|
||||
/*
|
||||
BiosResult result = ReadWriteMBR (false, drive);
|
||||
if (result != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags;
|
||||
result = ReadWriteMBR (true, drive);
|
||||
*/
|
||||
|
||||
BiosResult result = ReadWriteSectors (false, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, mbrSector, 8, false);
|
||||
if (result != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
CopyMemory (TC_BOOT_LOADER_BUFFER_SEGMENT, 0, SectorBuffer, TC_LB_SIZE);
|
||||
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags;
|
||||
CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT,0, TC_LB_SIZE);
|
||||
|
||||
result = ReadWriteSectors (true, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, mbrSector, 8, false);
|
||||
|
||||
ret:
|
||||
ReleaseSectorBuffer();
|
||||
|
Loading…
Reference in New Issue
Block a user