Bug fix for Win7

This commit is contained in:
Jack Andersen 2019-03-23 22:05:17 -10:00
parent ef7a9633c6
commit 0b3fd2b5af
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}