Index: src/libchcore/TLocalFilesystemFile.cpp =================================================================== diff -u -N -ra4635addad389b9e117679437a3e1b64a739ea96 -r38031c379667959206abe69507d8a4e3b040dba6 --- src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision a4635addad389b9e117679437a3e1b64a739ea96) +++ src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision 38031c379667959206abe69507d8a4e3b040dba6) @@ -325,6 +325,19 @@ } } + void TLocalFilesystemFile::CancelIo() + { + if(IsOpen()) + { + if(!::CancelIo(m_hFile)) + { + DWORD dwLastError = GetLastError(); + LOG_ERROR(m_spLog) << L"CancelIo request failed with error " << dwLastError << GetFileInfoForLog(m_bNoBuffering); + throw TFileException(eErr_CancelIoFailed, dwLastError, m_pathFile, L"Error while writing to file", LOCATION); + } + } + } + bool TLocalFilesystemFile::IsOpen() const { return m_hFile != INVALID_HANDLE_VALUE;