aboutsummaryrefslogtreecommitdiff
path: root/src/SFileVerify.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2025-07-03 09:27:16 +0200
committerLadislav Zezula <zezula@volny.cz>2025-07-03 09:27:16 +0200
commit486a7dd29f3bdf884d4be5588d9171daa5da1bae (patch)
tree95d9d099a84a3587412eecffd2485da99820916b /src/SFileVerify.cpp
parentb41cda40f9c3fbdb802cf63e739425cd805eecaa (diff)
Replaced GetLastError with SErrGetLastError
Diffstat (limited to 'src/SFileVerify.cpp')
-rw-r--r--src/SFileVerify.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/SFileVerify.cpp b/src/SFileVerify.cpp
index 9bbbb6b..96b5725 100644
--- a/src/SFileVerify.cpp
+++ b/src/SFileVerify.cpp
@@ -411,7 +411,7 @@ static DWORD VerifyRawMpqData(
{
// Read the array of MD5
if(!FileStream_Read(ha->pStream, &DataOffset, pbMD5Array2, dwMD5Size))
- dwErrCode = GetLastError();
+ dwErrCode = SErrGetLastError();
}
// Compare the array of MD5
@@ -631,7 +631,7 @@ static DWORD VerifyFile(
SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL);
if(dwBytesRead == 0)
{
- if(GetLastError() == ERROR_CHECKSUM_ERROR)
+ if(SErrGetLastError() == ERROR_CHECKSUM_ERROR)
dwVerifyResult |= VERIFY_FILE_SECTOR_CRC_ERROR;
break;
}
@@ -868,7 +868,7 @@ DWORD SSignFileFinish(TMPQArchive * ha)
// Write the signature to the MPQ. Don't use SFile* functions, but write the hash directly
if(!FileStream_Write(ha->pStream, &si.BeginExclude, WeakSignature, MPQ_SIGNATURE_FILE_SIZE))
- return GetLastError();
+ return SErrGetLastError();
return ERROR_SUCCESS;
}
@@ -895,7 +895,7 @@ bool WINAPI SFileGetFileChecksums(HANDLE hMpq, const char * szFileName, LPDWORD
// If verification failed, return zero
if(dwVerifyResult & VERIFY_FILE_ERROR_MASK)
{
- SetLastError(ERROR_FILE_CORRUPT);
+ SErrSetLastError(ERROR_FILE_CORRUPT);
return false;
}
@@ -1026,21 +1026,21 @@ bool WINAPI SFileSignArchive(HANDLE hMpq, DWORD dwSignatureType)
ha = IsValidMpqHandle(hMpq);
if(ha == NULL)
{
- SetLastError(ERROR_INVALID_PARAMETER);
+ SErrSetLastError(ERROR_INVALID_PARAMETER);
return false;
}
// We only support weak signature, and only for MPQs version 1.0
if(dwSignatureType != SIGNATURE_TYPE_WEAK)
{
- SetLastError(ERROR_INVALID_PARAMETER);
+ SErrSetLastError(ERROR_INVALID_PARAMETER);
return false;
}
// The archive must not be malformed and must not be read-only
if(ha->dwFlags & (MPQ_FLAG_READ_ONLY | MPQ_FLAG_MALFORMED))
{
- SetLastError(ERROR_ACCESS_DENIED);
+ SErrSetLastError(ERROR_ACCESS_DENIED);
return false;
}