diff --git a/Source/appfat.cpp b/Source/appfat.cpp index b92c3caa8..461208819 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -47,7 +47,7 @@ char *__fastcall GetErrorStr(DWORD error_code) } #define CASE_ERROR(v, errName) \ - case errName: \ + case (DWORD)errName: \ v = #errName; \ break; diff --git a/Source/effects.cpp b/Source/effects.cpp index 8930c692e..3f1c64d41 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -4,7 +4,7 @@ int sfxdelay; // weak int sfxdnum; -void *sfx_stream; +HANDLE sfx_stream; TSFX *sfx_data_cur; const char monster_action_sounds[] = { 'a', 'h', 'd', 's' }; // idb diff --git a/Source/effects.h b/Source/effects.h index 2bb158d46..49a2a223d 100644 --- a/Source/effects.h +++ b/Source/effects.h @@ -4,7 +4,7 @@ extern int sfxdelay; // weak extern int sfxdnum; -extern void *sfx_stream; +extern HANDLE sfx_stream; extern TSFX *sfx_data_cur; BOOL __fastcall effect_is_playing(int nSFX); diff --git a/Source/engine.cpp b/Source/engine.cpp index d083cf310..d436ff85f 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -1614,7 +1614,7 @@ void __fastcall LoadFileWithMem(char *pszName, void *buf) char *v2; // ebx char *v3; // edi int v4; // esi - void *a1; // [esp+Ch] [ebp-4h] + HANDLE a1; // [esp+Ch] [ebp-4h] v2 = (char *)buf; v3 = pszName; diff --git a/Source/fault.cpp b/Source/fault.cpp index c89f14cbe..f4a5a44b9 100644 --- a/Source/fault.cpp +++ b/Source/fault.cpp @@ -232,7 +232,7 @@ char *__fastcall exception_get_error_type(DWORD dwMessageId, LPSTR lpString1, DW CASE_EXCEPTION(v4, ACCESS_VIOLATION); default: ntdll = GetModuleHandle("NTDLL.DLL"); - if (!FormatMessage(FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, ntdll, dwMessageId, 0, lpString1, nSize, NULL)) { + if (!FormatMessage(FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, (LPCVOID)ntdll, dwMessageId, 0, lpString1, nSize, NULL)) { v4 = "*unknown*"; } } diff --git a/Source/init.cpp b/Source/init.cpp index 4b39d79f6..f85f3e8a0 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -5,12 +5,12 @@ _SNETVERSIONDATA fileinfo; int gbActive; // weak char diablo_exe_path[260]; -void *unused_mpq; +HANDLE unused_mpq; char patch_rt_mpq_path[260]; WNDPROC CurrentProc; -void *diabdat_mpq; +HANDLE diabdat_mpq; char diabdat_mpq_path[260]; -void *patch_rt_mpq; +HANDLE patch_rt_mpq; int killed_mom_parent; // weak BOOLEAN screensaver_enabled_prev; @@ -126,7 +126,7 @@ void __fastcall init_disable_screensaver(BOOLEAN disable) // SystemParametersInfo() with SPI_SETSCREENSAVEACTIVE/SPI_SETPOWEROFFACTIVE/SPI_SETLOWPOWERACTIVE v6 = disable; - if (!RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ | KEY_WRITE, &phkResult)) { + if (!RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ | KEY_WRITE, (PHKEY)&phkResult)) { if (v6) { cbData = 16; if (!RegQueryValueEx(phkResult, "ScreenSaveActive", 0, &Type, (LPBYTE)Data, &cbData)) @@ -228,7 +228,7 @@ void __cdecl init_await_mom_parent_exit() void __cdecl init_archives() { - void *a1; // [esp+8h] [ebp-8h] + HANDLE a1; // [esp+8h] [ebp-8h] #ifdef COPYPROT int v1; // [esp+Ch] [ebp-4h] #endif @@ -257,7 +257,7 @@ void __cdecl init_archives() patch_rt_mpq = init_test_access(patch_rt_mpq_path, "\\patch_rt.mpq", "DiabloInstall", 2000, FS_PC); } -void *__fastcall init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs) +HANDLE __fastcall init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs) { char *v5; // esi char *v7; // eax @@ -265,7 +265,7 @@ void *__fastcall init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, char Buffer[260]; // [esp+110h] [ebp-210h] char v15[260]; // [esp+214h] [ebp-10Ch] char *mpq_namea; // [esp+318h] [ebp-8h] - void *archive; // [esp+31Ch] [ebp-4h] + HANDLE archive; // [esp+31Ch] [ebp-4h] mpq_namea = mpq_name; v5 = mpq_path; @@ -331,7 +331,7 @@ char *__fastcall init_strip_trailing_slash(char *path) return result; } -int __fastcall init_read_test_file(char *mpq_path, char *mpq_name, int flags, void **archive) +int __fastcall init_read_test_file(char *mpq_path, char *mpq_name, int flags, HANDLE *archive) { char *v4; // edi DWORD v5; // eax diff --git a/Source/init.h b/Source/init.h index 4a5a51ac0..4eabe8f76 100644 --- a/Source/init.h +++ b/Source/init.h @@ -5,12 +5,12 @@ extern _SNETVERSIONDATA fileinfo; extern int gbActive; // weak extern char diablo_exe_path[260]; -extern void *unused_mpq; +extern HANDLE unused_mpq; extern char patch_rt_mpq_path[260]; extern WNDPROC CurrentProc; -extern void *diabdat_mpq; +extern HANDLE diabdat_mpq; extern char diabdat_mpq_path[260]; -extern void *patch_rt_mpq; +extern HANDLE patch_rt_mpq; extern int killed_mom_parent; // weak extern BOOLEAN screensaver_enabled_prev; @@ -23,9 +23,9 @@ void __cdecl init_kill_mom_parent(); HWND __cdecl init_find_mom_parent(); void __cdecl init_await_mom_parent_exit(); void __cdecl init_archives(); -void *__fastcall init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs); +HANDLE __fastcall init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs); char *__fastcall init_strip_trailing_slash(char *path); -int __fastcall init_read_test_file(char *mpq_path, char *mpq_name, int flags, void **archive); +int __fastcall init_read_test_file(char *mpq_path, char *mpq_name, int flags, HANDLE *archive); void __cdecl init_get_file_info(); LRESULT __stdcall MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void __fastcall init_activate_window(HWND hWnd, BOOLEAN bActive); diff --git a/Source/logging.cpp b/Source/logging.cpp index a42fabdf6..dfbcd324e 100644 --- a/Source/logging.cpp +++ b/Source/logging.cpp @@ -43,7 +43,7 @@ void __cdecl log_cleanup_mutex(void) void __cdecl log_flush(BOOLEAN force_close) { - void *v1; // eax + HANDLE v1; // eax DWORD NumberOfBytesWritten; // [esp+8h] [ebp-4h] EnterCriticalSection(&sgMemCrit); @@ -51,7 +51,7 @@ void __cdecl log_flush(BOOLEAN force_close) if (log_file == (HANDLE)-1) { v1 = log_create(); log_file = v1; - if (v1 == (void *)-1) { + if (v1 == (HANDLE)-1) { nNumberOfBytesToWrite = 0; return; } @@ -67,10 +67,10 @@ void __cdecl log_flush(BOOLEAN force_close) LeaveCriticalSection(&sgMemCrit); } -void *__cdecl log_create() +HANDLE __cdecl log_create() { char *v0; // eax - void *v1; // ebx + HANDLE v1; // ebx HANDLE v2; // eax char *v3; // edx char Filename[260]; // [esp+Ch] [ebp-15Ch] @@ -97,7 +97,7 @@ void *__cdecl log_create() file_info.dwProductVersionLS >> 16, _LOWORD(file_info.dwProductVersionLS)); } - v1 = (void *)-1; + v1 = (HANDLE)-1; for (pcbBuffer = log_not_created == 0; (signed int)pcbBuffer < 2; ++pcbBuffer) { v2 = CreateFile(FileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); v1 = v2; diff --git a/Source/logging.h b/Source/logging.h index 3bef0a668..63a15161b 100644 --- a/Source/logging.h +++ b/Source/logging.h @@ -11,7 +11,7 @@ void __cdecl log_init_mutex(); void __cdecl j_log_cleanup_mutex(); void __cdecl log_cleanup_mutex(void); void __cdecl log_flush(BOOLEAN force_close); -void *__cdecl log_create(); // should be HANDLE +HANDLE __cdecl log_create(); // should be HANDLE void __fastcall log_get_version(VS_FIXEDFILEINFO *file_info); void log_printf(const char *pszFmt, ...); // LogMessage void __cdecl log_dump_computer_info(); diff --git a/Source/movie.cpp b/Source/movie.cpp index 6178c4876..cb24d0bf4 100644 --- a/Source/movie.cpp +++ b/Source/movie.cpp @@ -8,7 +8,7 @@ BOOL loop_movie; void __fastcall play_movie(char *pszMovie, BOOL user_can_close) { WNDPROC saveProc; - void *video_stream; + HANDLE video_stream; if (!gbActive) { return; diff --git a/Source/palette.cpp b/Source/palette.cpp index 6fdcba148..54e336537 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -94,7 +94,7 @@ void __fastcall LoadPalette(char *pszFileName) { int i; // eax char PalData[256][3]; // [esp+0h] [ebp-304h] - void *pBuf; // [esp+300h] [ebp-4h] + HANDLE pBuf; // [esp+300h] [ebp-4h] WOpenFile(pszFileName, &pBuf, 0); WReadFile(pBuf, (char *)PalData, 768); diff --git a/Source/player.cpp b/Source/player.cpp index 45c39d662..9ec8b6d68 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -316,7 +316,7 @@ DWORD __fastcall GetPlrGFXSize(char *szCel) { char prefix[16]; char pszName[256]; - void *file; + HANDLE file; int c, a, w; DWORD size, result;