aboutsummaryrefslogtreecommitdiff
path: root/src/StormCommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/StormCommon.h')
-rw-r--r--src/StormCommon.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/StormCommon.h b/src/StormCommon.h
index bf82039..cefb92c 100644
--- a/src/StormCommon.h
+++ b/src/StormCommon.h
@@ -239,8 +239,8 @@ DWORD SMemStrToBin(const XCHAR * szString, void * pvBinary, size_t cbBinary, siz
BYTE StringByte0 = (BYTE)szString[0];
BYTE StringByte1 = (BYTE)szString[1];
- // Each character must be within the range of 0x80
- if(StringByte0 > 0x80 || StringByte1 > 0x80)
+ // Each character must be within the range of 0x00-0x7F
+ if(StringByte0 >= 0x80 || StringByte1 >= 0x80)
return ERROR_INVALID_PARAMETER;
if(SMemCharToByte[StringByte0] == 0xFF || SMemCharToByte[StringByte1] == 0xFF)
return ERROR_INVALID_PARAMETER;
@@ -277,6 +277,12 @@ void StringCat(TCHAR * szTarget, size_t cchTargetMax, const char * szSource);
#endif
//-----------------------------------------------------------------------------
+// UTF-8 support
+
+DWORD UTF8_DecodeCodePoint(const BYTE * pbString, const BYTE * pbStringEnd, DWORD & dwCodePoint, size_t & ccBytesEaten);
+size_t UTF8_EncodeCodePoint(DWORD dwCodePoint, LPBYTE Utf8Buffer);
+
+//-----------------------------------------------------------------------------
// Encryption and decryption functions
#define MPQ_HASH_TABLE_INDEX 0x000
@@ -327,7 +333,7 @@ DWORD ConvertMpqHeaderToFormat4(TMPQArchive * ha, ULONGLONG MpqOffset, ULONGLONG
bool IsValidHashEntry(TMPQArchive * ha, TMPQHash * pHash);
-TMPQHash * FindFreeHashEntry(TMPQArchive * ha, DWORD dwStartIndex, DWORD dwName1, DWORD dwName2, LCID lcFileLocale);
+TMPQHash * FindFreeHashEntry(TMPQArchive * ha, DWORD dwStartIndex, DWORD dwHashCheck1, DWORD dwHashCheck2, LCID lcFileLocale);
TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName);
TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash * pPrevHash);
TMPQHash * AllocateHashEntry(TMPQArchive * ha, TFileEntry * pFileEntry, LCID lcFileLocale);
@@ -360,7 +366,7 @@ void FreeBetTable(TMPQBetTable * pBetTable);
// Functions for finding files in the file table
TFileEntry * GetFileEntryLocale(TMPQArchive * ha, const char * szFileName, LCID lcFileLocale, LPDWORD PtrHashIndex = NULL);
-TFileEntry * GetFileEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcFileLocale, LPDWORD PtrHashIndex);
+TFileEntry * GetFileEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcFileLocale, LPDWORD PtrHashIndex = NULL);
// Allocates file name in the file entry
void AllocateFileName(TMPQArchive * ha, TFileEntry * pFileEntry, const char * szFileName);