Clone
ixen
committed
on 09 Dec 20
Fixed assertion when scrolling options list.
src/libchcore/TLocalFilesystemFile.cpp (+1 -0)
11 11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 12 //  GNU General Public License for more details.
13 13 //
14 14 //  You should have received a copy of the GNU Library General Public
15 15 //  License along with this program; if not, write to the
16 16 //  Free Software Foundation, Inc.,
17 17 //  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 18 // ============================================================================
19 19 #include "stdafx.h"
20 20 #include "TLocalFilesystemFile.h"
21 21 #include "TBufferSizes.h"
22 22 #include "TCoreException.h"
23 23 #include "ErrorCodes.h"
24 24 #include <boost/numeric/conversion/cast.hpp>
25 25 #include "RoundingFunctions.h"
26 26 #include "TLocalFilesystem.h"
27 27 #include "TFileException.h"
28 28 #include "TFileInfo.h"
29 29 #include "StreamingHelpers.h"
30 30 #include "TOverlappedDataBufferQueue.h"
  31 #include "OverlappedCallbacks.h"
31 32
32 33 namespace chcore
33 34 {
34 35         // compile-time check - ensure the buffer granularity used for transfers are bigger than expected sector size
35 36         static_assert(TLocalFilesystemFile::MaxSectorSize <= TBufferSizes::BufferGranularity, "Buffer granularity must be equal to or bigger than the max sector size");
36 37
37 38         TLocalFilesystemFile::TLocalFilesystemFile(const TSmartPath& pathFile, bool bNoBuffering, const logger::TLogFileDataPtr& spLogFileData) :
38 39                 m_pathFile(TLocalFilesystem::PrependPathExtensionIfNeeded(pathFile)),
39 40                 m_hFile(INVALID_HANDLE_VALUE),
40 41                 m_bNoBuffering(bNoBuffering),
41 42                 m_spLog(logger::MakeLogger(spLogFileData, L"Filesystem-File"))
42 43         {
43 44                 if (pathFile.IsEmpty())
44 45                         throw TCoreException(eErr_InvalidArgument, L"pathFile", LOCATION);
45 46         }
46 47
47 48         TLocalFilesystemFile::~TLocalFilesystemFile()
48 49         {
49 50                 try
50 51                 {