mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-28 14:03:29 +01:00
Windows MBR Bootloader: better way to handle displaying write errors in WriteEncryptedSectors function
This commit is contained in:
parent
3818b443c3
commit
8e9627877d
@ -108,19 +108,22 @@ BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byt
|
|||||||
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo);
|
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ReadWriteSectors (true, SectorBuffer, drive, sector + writeOffset, 1, false);
|
result = ReadWriteSectors (true, SectorBuffer, drive, sector + writeOffset, 1, true);
|
||||||
if (BiosResultTimeout == result)
|
if (BiosResultTimeout == result)
|
||||||
{
|
{
|
||||||
result = ReadWriteSectors (false, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, sector + writeOffset, 8, false);
|
if (BiosResultSuccess == ReadWriteSectors (false, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, sector + writeOffset, 8, false))
|
||||||
if (BiosResultSuccess == result)
|
|
||||||
{
|
{
|
||||||
CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT,0, TC_LB_SIZE);
|
CopyMemory (SectorBuffer, TC_BOOT_LOADER_BUFFER_SEGMENT,0, TC_LB_SIZE);
|
||||||
result = ReadWriteSectors (true, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, sector + writeOffset, 8, false);
|
result = ReadWriteSectors (true, TC_BOOT_LOADER_BUFFER_SEGMENT, 0, drive, sector + writeOffset, 8, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != BiosResultSuccess)
|
if (result != BiosResultSuccess)
|
||||||
|
{
|
||||||
|
sector += writeOffset;
|
||||||
|
PrintDiskError (result, true, drive, §or);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
++sector;
|
++sector;
|
||||||
++dataUnitNo;
|
++dataUnitNo;
|
||||||
|
Loading…
Reference in New Issue
Block a user