mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-01-23 15:56:18 +01:00
+ Improved key detection for archives with large sector sizes
This commit is contained in:
@@ -413,7 +413,7 @@ bool WINAPI SFileOpenArchive(
|
||||
if(nError != ERROR_SUCCESS)
|
||||
{
|
||||
FileStream_Close(pStream);
|
||||
FreeMPQArchive(ha);
|
||||
FreeArchiveHandle(ha);
|
||||
SetLastError(nError);
|
||||
ha = NULL;
|
||||
}
|
||||
@@ -509,11 +509,16 @@ bool WINAPI SFileCloseArchive(HANDLE hMpq)
|
||||
TMPQArchive * ha = (TMPQArchive *)hMpq;
|
||||
bool bResult;
|
||||
|
||||
// Invalidate the add file callback so it won't be called
|
||||
// when saving (listfile) and (attributes)
|
||||
ha->pfnAddFileCB = NULL;
|
||||
ha->pvAddFileUserData = NULL;
|
||||
|
||||
// Flush all unsaved data to the storage
|
||||
bResult = SFileFlushArchive(hMpq);
|
||||
|
||||
// Free all memory used by MPQ archive
|
||||
FreeMPQArchive(ha);
|
||||
FreeArchiveHandle(ha);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user