r5sdk/r5dev/dllmain.cpp
Amos 683dcfe534 Improve code and readability
Additional cleanup and micro refactor of the console. New signature for S2+ SQVM's. Every release of the game executable is now supported
2021-04-17 04:51:04 -07:00

50 lines
881 B
C++

#include <string>
#include <Windows.h>
#include "r5dev.h"
#include "console.h"
#include "utilities.h"
#include "hooks.h"
__declspec(dllexport) void DummyExport()
{
// Required for detours.
}
//---------------------------------------------------------------------------------
// Main
//---------------------------------------------------------------------------------
void InitializeR5Dev()
{
SetupConsole();
InstallHooks();
printf("R5 Dev -- Initialized...\n");
}
void TerminateR5Dev()
{
RemoveHooks();
FreeConsole();
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
InitializeR5Dev();
break;
}
case DLL_PROCESS_DETACH:
{
TerminateR5Dev();
break;
}
}
return TRUE;
}