aboutsummaryrefslogtreecommitdiff
path: root/src/SFileAddFile.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avg.com>2014-03-14 10:17:34 +0100
committerLadislav Zezula <ladislav.zezula@avg.com>2014-03-14 10:17:34 +0100
commit568f189ea5a850a9259c8c89ba5f28a0630a2ce0 (patch)
tree80f02483aced5969b3bc4e8ed52415d0bfa0d8e9 /src/SFileAddFile.cpp
parentca93a8cb76edb459a94e56a85c45a29a881dfc16 (diff)
+ Improved key detection for archives with large sector sizes
Diffstat (limited to 'src/SFileAddFile.cpp')
-rw-r--r--src/SFileAddFile.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/SFileAddFile.cpp b/src/SFileAddFile.cpp
index a7d99ea..040ed57 100644
--- a/src/SFileAddFile.cpp
+++ b/src/SFileAddFile.cpp
@@ -394,7 +394,7 @@ int SFileAddFile_Init(
lcLocale = 0;
// Allocate the TMPQFile entry for newly added file
- hf = CreateMpqFile(ha);
+ hf = CreateFileHandle(ha, NULL);
if(hf == NULL)
nError = ERROR_NOT_ENOUGH_MEMORY;
@@ -664,7 +664,7 @@ int SFileAddFile_Finish(TMPQFile * hf)
}
// Clear the add file callback
- FreeMPQFile(hf);
+ FreeFileHandle(hf);
return nError;
}
@@ -1143,12 +1143,10 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
// with the new decryption key
if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)
{
- hf = CreateMpqFile(ha);
+ hf = CreateFileHandle(ha, pFileEntry);
if(hf != NULL)
{
// Recrypt the file data in the MPQ
- hf->pFileEntry = pFileEntry;
- hf->dwDataSize = pFileEntry->dwFileSize;
nError = RecryptFileData(ha, hf, szFileName, szNewFileName);
// Update the MD5
@@ -1161,7 +1159,7 @@ bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * s
ha->pHeader->dwRawChunkSize);
}
- FreeMPQFile(hf);
+ FreeFileHandle(hf);
}
else
{