mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-17 23:45:21 +01:00
Windows: ignore errors from FlushFileBuffers()
Appereantly the function does not work as advertised on Windows 7. Do call it, but ignore errors. Hopefully any real write errors, will be detected when reading back image instead.
This commit is contained in:
parent
560759fe0c
commit
b269d0b522
1 changed files with 4 additions and 3 deletions
|
@ -30,7 +30,7 @@ bool WinFile::open(QIODevice::OpenMode)
|
|||
|
||||
for (int attempt = 0; attempt < 20; attempt++)
|
||||
{
|
||||
_h = CreateFileA(n.data(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
_h = CreateFileA(n.data(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (_h != INVALID_HANDLE_VALUE)
|
||||
break;
|
||||
|
||||
|
@ -143,8 +143,9 @@ bool WinFile::flush()
|
|||
{
|
||||
if (!FlushFileBuffers(_h))
|
||||
{
|
||||
_lasterror = qt_error_string();
|
||||
return false;
|
||||
// Windows 7 does not support flush properly, so ignore errors
|
||||
//_lasterror = qt_error_string();
|
||||
//return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue