Browse Source

Correct type of dwChar in mpqapi.cpp

pull/133/head
Anders Jenbo 7 years ago
parent
commit
2270bad1b9
  1. 16
      Source/mpqapi.cpp
  2. 15
      Source/mpqapi.h

16
Source/mpqapi.cpp

@ -29,7 +29,7 @@ BOOL mpqapi_set_hidden(const char *pszArchive, BOOL hidden)
return SetFileAttributes(pszArchive, dwFileAttributesToSet);
}
void mpqapi_store_creation_time(const char *pszArchive, int dwChar)
void mpqapi_store_creation_time(const char *pszArchive, DWORD dwChar)
{
HANDLE handle;
struct _WIN32_FIND_DATAA FindFileData;
@ -283,7 +283,7 @@ _BLOCKENTRY *mpqapi_add_file(const char *pszName, _BLOCKENTRY *pBlk, int block_i
return pBlk;
}
BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, int dwLen, _BLOCKENTRY *pBlk)
BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, DWORD dwLen, _BLOCKENTRY *pBlk)
{
const char *v4; // esi
const char *v5; // eax
@ -432,7 +432,7 @@ BOOL mpqapi_has_file(const char *pszName)
return FetchHandle(pszName) != -1;
}
BOOL OpenMPQ(const char *pszArchive, BOOL hidden, int dwChar)
BOOL OpenMPQ(const char *pszArchive, BOOL hidden, DWORD dwChar)
{
const char *v3; // ebp
BOOL v4; // esi
@ -461,7 +461,7 @@ BOOL OpenMPQ(const char *pszArchive, BOOL hidden, int dwChar)
}
if (!sgpBlockTbl || !sgpHashTbl) {
memset(&fhdr, 0, sizeof(fhdr));
if (!ParseMPQHeader(&fhdr, (int *)&sgdwMpqOffset)) {
if (!ParseMPQHeader(&fhdr, &sgdwMpqOffset)) {
LABEL_15:
CloseMPQ(lpFileName, 1, dwChar);
return 0;
@ -493,7 +493,7 @@ BOOL OpenMPQ(const char *pszArchive, BOOL hidden, int dwChar)
// 65AB14: using guessed type char save_archive_open;
// 679660: using guessed type char gbMaxPlayers;
BOOL ParseMPQHeader(_FILEHEADER *pHdr, int *pdwNextFileStart)
BOOL ParseMPQHeader(_FILEHEADER *pHdr, DWORD *pdwNextFileStart)
{
DWORD size;
DWORD NumberOfBytesRead;
@ -533,7 +533,7 @@ BOOL ParseMPQHeader(_FILEHEADER *pHdr, int *pdwNextFileStart)
return TRUE;
}
void CloseMPQ(const char *pszArchive, BOOL bFree, int dwChar)
void CloseMPQ(const char *pszArchive, BOOL bFree, DWORD dwChar)
{
if (bFree) {
MemFreeDbg(sgpBlockTbl);
@ -553,7 +553,7 @@ void CloseMPQ(const char *pszArchive, BOOL bFree, int dwChar)
}
}
void mpqapi_store_modified_time(const char *pszArchive, int dwChar)
void mpqapi_store_modified_time(const char *pszArchive, DWORD dwChar)
{
HANDLE handle;
struct _WIN32_FIND_DATAA FindFileData;
@ -570,7 +570,7 @@ void mpqapi_store_modified_time(const char *pszArchive, int dwChar)
}
}
BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, int dwChar)
BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, DWORD dwChar)
{
BOOL ret = FALSE;
if (sghArchive == INVALID_HANDLE_VALUE)

15
Source/mpqapi.h

@ -7,12 +7,11 @@ extern BOOL save_archive_modified; // weak
extern BOOLEAN save_archive_open; // weak
BOOL mpqapi_set_hidden(const char *pszArchive, BOOL hidden);
void mpqapi_store_creation_time(const char *pszArchive, int dwChar);
void mpqapi_store_creation_time(const char *pszArchive, DWORD dwChar);
BOOL mpqapi_reg_load_modification_time(char *dst, int size);
void mpqapi_xor_buf(char *pbData);
void mpqapi_store_default_time(DWORD dwChar);
BOOLEAN mpqapi_reg_store_modification_time(char *pbData, DWORD dwLen);
_BLOCKENTRY *j_mpqapi_remove_hash_entry(char *pszName);
void mpqapi_remove_hash_entry(const char *pszName);
void mpqapi_alloc_block(int block_offset, int block_size);
_BLOCKENTRY *mpqapi_new_block(int *block_index);
@ -21,15 +20,15 @@ int mpqapi_get_hash_index(short index, int hash_a, int hash_b, int locale);
void mpqapi_remove_hash_entries(BOOL(__stdcall *fnGetName)(DWORD, char *));
BOOL mpqapi_write_file(const char *pszName, const BYTE *pbData, DWORD dwLen);
_BLOCKENTRY *mpqapi_add_file(const char *pszName, _BLOCKENTRY *pBlk, int block_index);
BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, int dwLen, _BLOCKENTRY *pBlk);
BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, DWORD dwLen, _BLOCKENTRY *pBlk);
int mpqapi_find_free_block(int size, int *block_size);
void mpqapi_rename(char *pszOld, char *pszNew);
BOOL mpqapi_has_file(const char *pszName);
BOOL OpenMPQ(const char *pszArchive, BOOL hidden, int dwChar);
BOOL ParseMPQHeader(_FILEHEADER *pHdr, int *pdwNextFileStart);
void CloseMPQ(const char *pszArchive, BOOL bFree, int dwChar);
void mpqapi_store_modified_time(const char *pszArchive, int dwChar);
BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, int dwChar);
BOOL OpenMPQ(const char *pszArchive, BOOL hidden, DWORD dwChar);
BOOL ParseMPQHeader(_FILEHEADER *pHdr, DWORD *pdwNextFileStart);
void CloseMPQ(const char *pszArchive, BOOL bFree, DWORD dwChar);
void mpqapi_store_modified_time(const char *pszArchive, DWORD dwChar);
BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, DWORD dwChar);
BOOL WriteMPQHeader();
BOOL mpqapi_write_block_table();
BOOL mpqapi_write_hash_table();

Loading…
Cancel
Save