mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55: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++)
|
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)
|
if (_h != INVALID_HANDLE_VALUE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -143,8 +143,9 @@ bool WinFile::flush()
|
||||||
{
|
{
|
||||||
if (!FlushFileBuffers(_h))
|
if (!FlushFileBuffers(_h))
|
||||||
{
|
{
|
||||||
_lasterror = qt_error_string();
|
// Windows 7 does not support flush properly, so ignore errors
|
||||||
return false;
|
//_lasterror = qt_error_string();
|
||||||
|
//return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue