mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-27 13:14:26 -04:00
[core] speed up the clearing of MBR/GPT sectors
* write_sector() should really only be used when writing single sectors as it
is way to slow for anything else => Switch to using WriteFileWithRetry().
* Also revert an unwarranted change from f0047986e7
.
This commit is contained in:
parent
f0047986e7
commit
9dc045a701
5 changed files with 27 additions and 26 deletions
|
@ -855,6 +855,10 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr
|
|||
DWORD nTry;
|
||||
BOOL readFilePointer;
|
||||
LARGE_INTEGER liFilePointer, liZero = { { 0,0 } };
|
||||
DWORD NumberOfBytesWritten;
|
||||
|
||||
if (lpNumberOfBytesWritten == NULL)
|
||||
lpNumberOfBytesWritten = &NumberOfBytesWritten;
|
||||
|
||||
// Need to get the current file pointer in case we need to retry
|
||||
readFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue