r5sdk/r5dev/launcher/prx.cpp
Kawe Mazidjatari a618990937 Detour code refactor
This change was planned for a long time. This moves all REGISTER calls to a single translation unit, this is required as we currently added a very dirty workaround for not registering duplicates by checking if VFTable pointer was already present in the vector... Registering from single translation unit prevents duplicate instances that gets created if header is included by more cpp files.
Reworking this reduced 100kb+ of compiled code. This commit also reworked the way functions/variables/constant gets logged with their addresses; the new code formats them on the fly, and allows for resize at any time. Formatting is no longer required by programmer.

TODO: currently there are some compile errors for dedicated and client dll's. These will be resolved very soon as they need to be properly worked out still (server & client only stuff needs to be properly split). Use the 'main' (stable) branch for the time being if you need to compile these dll's.
2023-01-25 02:26:52 +01:00

28 lines
699 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)
{
//SDK_Shutdown();
HANDLE h = GetCurrentProcess();
TerminateProcess(h, uExitCode);
}
void VPRX::Attach() const
{
#ifdef DEDICATED
//DetourAttach(&v_exit_or_terminate_process, &h_exit_or_terminate_process);
#endif // DEDICATED
}
void VPRX::Detach() const
{
#ifdef DEDICATED
//DetourDetach(&v_exit_or_terminate_process, &h_exit_or_terminate_process);
#endif // DEDICATED
}