+ Support for MPQs that have invalid (and ignored) flags in the block table

+ Support for MPQs that have malformed block indexes (0x8000xxxx or 0x4000xxxx)
This commit is contained in:
Ladislav Zezula
2016-05-27 16:50:50 +02:00
parent f1655f8afe
commit 47b6b6eb4a
5 changed files with 36 additions and 16 deletions

View File

@@ -309,8 +309,10 @@ bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearch
{
if(pFileEntry == NULL || (pFileEntry->dwFlags & MPQ_FILE_EXISTS) == 0)
nError = ERROR_FILE_NOT_FOUND;
if(pFileEntry != NULL && pFileEntry->dwFlags & ~MPQ_FILE_VALID_FLAGS)
nError = ERROR_NOT_SUPPORTED;
// Ignore unknown loading flags (example: MPQ_2016_v1_WME4_4.w3x)
// if(pFileEntry != NULL && pFileEntry->dwFlags & ~MPQ_FILE_VALID_FLAGS)
// nError = ERROR_NOT_SUPPORTED;
}
// Did the caller just wanted to know if the file exists?