Browse Source

Fix downstream 64-bit builds

pull/28/head
Max Desiatov 7 years ago committed by Anders Jenbo
parent
commit
269aa345bd
  1. 2
      Source/appfat.cpp
  2. 2
      Source/effects.cpp
  3. 2
      Source/effects.h
  4. 2
      Source/engine.cpp
  5. 2
      Source/fault.cpp
  6. 16
      Source/init.cpp
  7. 10
      Source/init.h
  8. 10
      Source/logging.cpp
  9. 2
      Source/logging.h
  10. 2
      Source/movie.cpp
  11. 2
      Source/palette.cpp
  12. 2
      Source/player.cpp

2
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;

2
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

2
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);

2
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;

2
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*";
}
}

16
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

10
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);

10
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;

2
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();

2
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;

2
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);

2
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;

Loading…
Cancel
Save