[saco] Implement/match exc_filter(...)

This commit is contained in:
RD42 committed 2024-07-12 18:01:15 +08:00
1 parent 3878481975
commit fc20e24d91
2 files changed
+36 -1

No files matched your search

+34 -1
View File
@@ -11,12 +11,15 @@ PCONTEXT pContextRecord;
extern HANDLE hInstance;
extern CGame *pGame;
extern CNetGame *pNetGame;
extern CChatWindow *pChatWindow;
extern DWORD dwScmOpcodeDebug;
extern BOOL bScmLocalDebug;
extern int iGtaVersion;
extern WORD wLastRendObj;
extern WORD wVehicleComponentDebug;
CHAR szErrorString[16384];
int dword_10125A58=0;
//----------------------------------------------------
@@ -226,4 +229,34 @@ LONG WINAPI exc_handler(_EXCEPTION_POINTERS* exc_inf)
return EXCEPTION_EXECUTE_HANDLER;
}
//----------------------------------------------------
//----------------------------------------------------
int exc_filter(unsigned int code, struct _EXCEPTION_POINTERS *ep, char *what)
{
if(pChatWindow)
{
if(!strcmp(what, "opcode"))
{
if(dwScmOpcodeDebug == 1767)
{
pChatWindow->AddDebugMessage("Warning(add_car_component %u): Exception 0x%X at 0x%X",
wVehicleComponentDebug, code, ep->ContextRecord->Eip);
return 1;
} else {
pChatWindow->AddDebugMessage("Warning(opcode 0x%X): Exception 0x%X at 0x%X",
dwScmOpcodeDebug, code, ep->ContextRecord->Eip);
}
} else {
pChatWindow->AddDebugMessage("Warning(%s): Exception 0x%X at 0x%X",
what, code, ep->ContextRecord->Eip);
}
}
if(dword_10125A58 < 10) {
dword_10125A58++;
return 1;
}
return 0;
}
//----------------------------------------------------
+2
View File
@@ -28,6 +28,8 @@ CUnkClass15 *pUnkClass15=0;
BOOL bGameInited=FALSE;
WORD wVehicleComponentDebug=0;
IDirect3D9 *pD3D;
IDirect3DDevice9 *pD3DDevice = NULL;