From 0b3fd2b5afae72938c72a7256d9b47eca1de9d5d Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 23 Mar 2019 22:05:17 -1000 Subject: [PATCH] Bug fix for Win7 --- src/athena/FileReaderWin32.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/athena/FileReaderWin32.cpp b/src/athena/FileReaderWin32.cpp index 44b0b9a..fd71e83 100644 --- a/src/athena/FileReaderWin32.cpp +++ b/src/athena/FileReaderWin32.cpp @@ -89,7 +89,8 @@ void FileReader::seek(atInt64 pos, SeekOrigin origin) { LARGE_INTEGER li; li.QuadPart = block * m_blockSize; SetFilePointerEx(m_fileHandle, li, nullptr, FILE_BEGIN); - ReadFile(m_fileHandle, m_cacheData.get(), m_blockSize, nullptr, nullptr); + DWORD readSz; + ReadFile(m_fileHandle, m_cacheData.get(), m_blockSize, &readSz, nullptr); m_curBlock = (atInt32)block; } } else { @@ -163,7 +164,8 @@ atUint64 FileReader::readUBytesToBuf(void* buf, atUint64 len) { LARGE_INTEGER li; li.QuadPart = block * m_blockSize; SetFilePointerEx(m_fileHandle, li, nullptr, FILE_BEGIN); - ReadFile(m_fileHandle, m_cacheData.get(), m_blockSize, nullptr, nullptr); + DWORD readSz; + ReadFile(m_fileHandle, m_cacheData.get(), m_blockSize, &readSz, nullptr); m_curBlock = (atInt32)block; }