r5sdk/r5dev/launcher/prx.cpp
Amos fd924b56e8 Shutdown dedicated dll properly
Systems where not getting shutdown properly. For dedicated 'ExitProcess()' in the GameDLL caused 'abort()' to get called even when systems where shutdown properly. We call TerminateProcess after all systems have shutdown properly in the SDK and GameDLL.
2022-02-18 14:00:58 +01:00

24 lines
619 B
C++

#include <core/stdafx.h>
#include <core/init.h>
#include <launcher/prx.h>
//-----------------------------------------------------------------------------
// Purpose: shutdown and unload SDK
//-----------------------------------------------------------------------------
void h_exit_or_terminate_process(UINT uExitCode)
{
R5Dev_Shutdown();
HANDLE h = GetCurrentProcess();
TerminateProcess(h, uExitCode);
}
void PRX_Attach()
{
DetourAttach((LPVOID*)&exit_or_terminate_process, &h_exit_or_terminate_process);
}
void PRX_Detach()
{
DetourAttach((LPVOID*)&exit_or_terminate_process, &h_exit_or_terminate_process);
}