From b30ebeb7a0f50df25a7eb4e9455244765531ac10 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 16 Apr 2019 04:49:42 +0200 Subject: [PATCH] Correct calling convention for diabloui.h functions IDA doesn't correctly detect calling convention for functions with no input/output. As seen in NetInit this should have been __stdcall instead of __cdecl --- DiabloUI/_temp_funcs.h | 4 ++-- DiabloUI/diabloui.cpp | 4 ++-- DiabloUI/diabloui.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DiabloUI/_temp_funcs.h b/DiabloUI/_temp_funcs.h index 4df4a5731..4afc93d1c 100644 --- a/DiabloUI/_temp_funcs.h +++ b/DiabloUI/_temp_funcs.h @@ -157,8 +157,8 @@ int __cdecl DiabloUI_GetSpawned(); void __stdcall UiOnPaint(int a1); void __stdcall UiSetBackgroundBitmap(int a1, PALETTEENTRY *a2, int a3, int a4, int a5); void __stdcall UiSetSpawned(BOOL bSpawned); -void __cdecl UiInitialize(); -void __cdecl UiDestroy(); +void __stdcall UiInitialize(); +void __stdcall UiDestroy(); void __stdcall UiAppActivate(BOOL bActive); BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); void __cdecl j_DiabloUI_cpp_init(); diff --git a/DiabloUI/diabloui.cpp b/DiabloUI/diabloui.cpp index 9d3d49ac3..b8e2b2f7d 100644 --- a/DiabloUI/diabloui.cpp +++ b/DiabloUI/diabloui.cpp @@ -98,7 +98,7 @@ void __stdcall UiSetSpawned(BOOL bSpawned) // 1002972C: using guessed type int sgbIsSpawn; // ref: 0x10005C73 -void __cdecl UiInitialize() +void __stdcall UiInitialize() { sgbUiIsInitialized = 1; TitleSnd_InitSoundFunc(); @@ -110,7 +110,7 @@ void __cdecl UiInitialize() // 10029714: using guessed type int sgbUiIsInitialized; // ref: 0x10005C96 -void __cdecl UiDestroy() +void __stdcall UiDestroy() { bn_prof_10002247(); local_FreeArtCursor(); diff --git a/DiabloUI/diabloui.h b/DiabloUI/diabloui.h index d44267349..349307aec 100644 --- a/DiabloUI/diabloui.h +++ b/DiabloUI/diabloui.h @@ -25,9 +25,9 @@ struct ProfFntStruct { int field_8; }; -void __cdecl UiDestroy(); +void __stdcall UiDestroy(); BOOL __stdcall UiTitleDialog(int a1); -void __cdecl UiInitialize(); +void __stdcall UiInitialize(); BOOL __stdcall UiCopyProtError(int *pdwResult); void __stdcall UiAppActivate(BOOL bActive); BOOL __fastcall UiValidPlayerName(char *name); /* check __stdcall */