From 9462aa782b6de986e10e7e7572e1a3f574d28cb1 Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Thu, 4 Apr 2019 00:16:36 +0900 Subject: [PATCH] fault: fix calling convention This should have been part of the previous commit :blush: --- Source/fault.cpp | 8 ++++---- Source/fault.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/fault.cpp b/Source/fault.cpp index 003449c72..b62f69f71 100644 --- a/Source/fault.cpp +++ b/Source/fault.cpp @@ -26,12 +26,12 @@ void __cdecl fault_init_filter() void __cdecl fault_cleanup_filter_atexit() { - atexit(fault_cleanup_filter); + atexit((void *)fault_cleanup_filter); } -void __cdecl fault_cleanup_filter(void) +LPTOP_LEVEL_EXCEPTION_FILTER __cdecl fault_cleanup_filter() { - fault_reset_filter(&fault_unused); + return fault_reset_filter(&fault_unused); } LONG __stdcall TopLevelExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) @@ -247,7 +247,7 @@ void __fastcall fault_set_filter(void *unused) lpTopLevelExceptionFilter = SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)TopLevelExceptionFilter); } -LPTOP_LEVEL_EXCEPTION_FILTER __cdecl fault_reset_filter(void *unused) +LPTOP_LEVEL_EXCEPTION_FILTER __fastcall fault_reset_filter(void *unused) { return SetUnhandledExceptionFilter(lpTopLevelExceptionFilter); } diff --git a/Source/fault.h b/Source/fault.h index 767ffb80d..cad8bb3bc 100644 --- a/Source/fault.h +++ b/Source/fault.h @@ -7,19 +7,19 @@ typedef struct STACK_FRAME { void *pCallRet; } STACK_FRAME; -//int dword_52B9F4; -extern LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter; // idb +extern int fault_unused; +extern LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter; void __cdecl fault_init_filter(); void __cdecl fault_cleanup_filter_atexit(); -void __cdecl fault_cleanup_filter(void); +LPTOP_LEVEL_EXCEPTION_FILTER __cdecl fault_cleanup_filter(); LONG __stdcall TopLevelExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo); void __fastcall fault_hex_format(BYTE *ptr, unsigned int numBytes); void __fastcall fault_unknown_module(LPCVOID lpAddress, LPSTR lpModuleName, int iMaxLength, int *sectionNum, int *sectionOffset); void __fastcall fault_call_stack(void *instr, STACK_FRAME *stackAddr); char *__fastcall fault_get_error_type(DWORD dwMessageId, LPSTR lpString1, DWORD nSize); void __fastcall fault_set_filter(void *unused); -LPTOP_LEVEL_EXCEPTION_FILTER __cdecl fault_reset_filter(void *unused); +LPTOP_LEVEL_EXCEPTION_FILTER __fastcall fault_reset_filter(void *unused); LPTOP_LEVEL_EXCEPTION_FILTER __cdecl fault_get_filter(); #endif /* __FAULT_H__ */