Skip to content

Commit b2afd1a

Browse files
committed
Update shell_windows.cpp
1 parent c2b8c9a commit b2afd1a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

game/source/shell/shell_windows.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
340340
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
341341
}
342342

343-
BOOL WINAPI HandlerRoutine(DWORD CtrlType)
343+
BOOL WINAPI control_handler_routine(DWORD CtrlType)
344344
{
345-
return INVOKE(0x0042E900, HandlerRoutine, CtrlType);
345+
return INVOKE(0x0042E900, control_handler_routine, CtrlType);
346346
}
347347

348348
char* __cdecl shell_get_command_line()
@@ -417,15 +417,15 @@ void __cdecl shell_platform_dispose()
417417
{
418418
//INVOKE(0x0042EA00, shell_platform_dispose);
419419

420-
SetConsoleCtrlHandler(HandlerRoutine, FALSE);
420+
SetConsoleCtrlHandler(control_handler_routine, FALSE);
421421
}
422422

423423
bool __cdecl shell_platform_initialize()
424424
{
425425
//return INVOKE(0x0042EA10, shell_platform_initialize);
426426

427-
SetConsoleCtrlHandler(HandlerRoutine, TRUE);
428-
SetUnhandledExceptionFilter(TopLevelExceptionFilter);
427+
SetConsoleCtrlHandler(control_handler_routine, TRUE);
428+
SetUnhandledExceptionFilter(unhandled_exception_handler);
429429
sub_42EA80();
430430

431431
return true;
@@ -473,17 +473,19 @@ void __cdecl sub_42EA80()
473473
}
474474
}
475475

476-
LONG WINAPI TopLevelExceptionFilter(_EXCEPTION_POINTERS* ExceptionInfo)
476+
LONG WINAPI unhandled_exception_handler(_EXCEPTION_POINTERS* ExceptionInfo)
477477
{
478-
return INVOKE(0x0042EAC0, TopLevelExceptionFilter, ExceptionInfo);
478+
return INVOKE(0x0042EAC0, unhandled_exception_handler, ExceptionInfo);
479479

480480
//if (!is_main_thread())
481481
//{
482482
// cache_exception_information(ExceptionInfo);
483483
// PostThreadMessageA(get_main_thread_id(), WM_NULL, 0, 0);
484484
//
485485
// while (true)
486-
// Sleep(1);
486+
// {
487+
// sleep(1);
488+
// }
487489
//}
488490
//return generic_exception_filter(ExceptionInfo->ExceptionRecord->ExceptionCode, ExceptionInfo);
489491
}

game/source/shell/shell_windows.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static_assert(sizeof(s_windows_params));
2626
extern s_windows_params& g_windows_params;
2727

2828
extern LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
29-
extern BOOL WINAPI HandlerRoutine(DWORD CtrlType);
29+
extern BOOL WINAPI control_handler_routine(DWORD CtrlType);
3030
extern char* __cdecl shell_get_command_line();
3131
extern void __cdecl shell_idle();
3232
extern void __cdecl shell_platform_dispose();
@@ -35,7 +35,7 @@ extern void __cdecl shell_platform_verify();
3535
extern void __cdecl shell_halt_if_necessary();
3636
extern void __cdecl shell_screen_pause(bool pause);
3737
extern void __cdecl sub_42EA80();
38-
extern LONG WINAPI TopLevelExceptionFilter(_EXCEPTION_POINTERS* ExceptionInfo);
38+
extern LONG WINAPI unhandled_exception_handler(_EXCEPTION_POINTERS* ExceptionInfo);
3939
extern int WINAPI _WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
4040
extern const char* __cdecl sub_5013A0();
4141
extern bool __cdecl input_process_key(UINT uMsg, WPARAM wParam, LPARAM lParam);

0 commit comments

Comments
 (0)