aboutsummaryrefslogtreecommitdiff
path: root/src/SFileListFile.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2025-08-06 09:38:55 +0200
committerGitHub <noreply@github.com>2025-08-06 09:38:55 +0200
commit36d76cddbfa02624617bb112da0b72e919f0cf33 (patch)
treecbe34ab3d2d2c7ab784ba890b7d2a3436bb6795b /src/SFileListFile.cpp
parentb41cda40f9c3fbdb802cf63e739425cd805eecaa (diff)
parentdb410fd564af358cb7c1e2e72cdbaeaeef510e09 (diff)
Merge pull request #393 from ladislav-zezula/LZ_BlizzardCompatibleNames
* Replaced GetLastError with SErrGetLastError * Members of TMPQHash have now the same names like in Blizzard sources * Fixed bug in SFileRenameFile that falsely reported an existing file if it had different locale.
Diffstat (limited to 'src/SFileListFile.cpp')
-rw-r--r--src/SFileListFile.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp
index b2a3a3c..3e7a175 100644
--- a/src/SFileListFile.cpp
+++ b/src/SFileListFile.cpp
@@ -203,7 +203,7 @@ static TListFileCache * CreateListFileCache(
}
// This combination should never happen
- SetLastError(ERROR_INVALID_PARAMETER);
+ SErrSetLastError(ERROR_INVALID_PARAMETER);
assert(false);
return NULL;
}
@@ -411,8 +411,8 @@ static DWORD SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szF
TFileEntry * pFileEntry;
TMPQHash * pHashEnd;
TMPQHash * pHash;
- DWORD dwName1;
- DWORD dwName2;
+ DWORD dwHashCheck1;
+ DWORD dwHashCheck2;
// If we have HET table, use that one
if(ha->pHetTable != NULL)
@@ -432,8 +432,8 @@ static DWORD SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szF
{
// Get the end of the hash table and both names
pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize;
- dwName1 = ha->pfnHashString(szFileName, MPQ_HASH_NAME_A);
- dwName2 = ha->pfnHashString(szFileName, MPQ_HASH_NAME_B);
+ dwHashCheck1 = ha->pfnHashString(szFileName, MPQ_HASH_NAME_A);
+ dwHashCheck2 = ha->pfnHashString(szFileName, MPQ_HASH_NAME_B);
// Some protectors set very high hash table size (0x00400000 items or more)
// in order to make this process very slow. We will ignore items
@@ -445,7 +445,7 @@ static DWORD SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szF
// Go through the hash table and put the name in each item that has the same name pair
for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++)
{
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && MPQ_BLOCK_INDEX(pHash) < ha->dwFileTableSize)
+ if(pHash->dwHashCheck1 == dwHashCheck1 && pHash->dwHashCheck2 == dwHashCheck2 && MPQ_BLOCK_INDEX(pHash) < ha->dwFileTableSize)
{
// Allocate file name for the file entry
AllocateFileName(ha, ha->pFileTable + MPQ_BLOCK_INDEX(pHash), szFileName);
@@ -649,7 +649,7 @@ static bool DoListFileSearch(TListFileCache * pCache, SFILE_FIND_DATA * lpFindFi
// No more files
memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA));
- SetLastError(ERROR_NO_MORE_FILES);
+ SErrSetLastError(ERROR_NO_MORE_FILES);
return false;
}
@@ -726,7 +726,7 @@ HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const TCHAR * szListFile, cons
if(!DoListFileSearch(pCache, lpFindFileData))
{
memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA));
- SetLastError(ERROR_NO_MORE_FILES);
+ SErrSetLastError(ERROR_NO_MORE_FILES);
FreeListFileCache(pCache);
pCache = NULL;
}