|
|
|
@ -711,7 +711,12 @@ bool STORMAPI SFileReadFile(HANDLE hFile, void * pvBuffer, DWORD dwToRead, LPDWO |
|
|
|
// If the file is local file, read the data directly from the stream
|
|
|
|
// If the file is local file, read the data directly from the stream
|
|
|
|
if(hf->pStream != NULL) |
|
|
|
if(hf->pStream != NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nError = ReadMpqFileLocalFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead); |
|
|
|
ULONGLONG pos; |
|
|
|
|
|
|
|
if (!FileStream_GetPos(hf->pStream, &pos)) { |
|
|
|
|
|
|
|
SetLastError(ERROR_CAN_NOT_COMPLETE); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
nError = ReadMpqFileLocalFile(hf, pvBuffer, pos, dwToRead, &dwBytesRead); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef FULL |
|
|
|
#ifdef FULL |
|
|
|
// If the file is a patch file, we have to read it special way
|
|
|
|
// If the file is a patch file, we have to read it special way
|
|
|
|
@ -739,7 +744,8 @@ bool STORMAPI SFileReadFile(HANDLE hFile, void * pvBuffer, DWORD dwToRead, LPDWO |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Increment the file position
|
|
|
|
// Increment the file position
|
|
|
|
hf->dwFilePos += dwBytesRead; |
|
|
|
if(hf->pStream == NULL) |
|
|
|
|
|
|
|
hf->dwFilePos += dwBytesRead; |
|
|
|
|
|
|
|
|
|
|
|
// Give the caller the number of bytes read
|
|
|
|
// Give the caller the number of bytes read
|
|
|
|
if(pdwRead != NULL) |
|
|
|
if(pdwRead != NULL) |
|
|
|
|