diff options
Diffstat (limited to 'NorthstarDLL/core')
-rw-r--r-- | NorthstarDLL/core/convar/concommand.cpp | 4 | ||||
-rw-r--r-- | NorthstarDLL/core/convar/convar.cpp | 10 | ||||
-rw-r--r-- | NorthstarDLL/core/hooks.cpp | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/NorthstarDLL/core/convar/concommand.cpp b/NorthstarDLL/core/convar/concommand.cpp index 732e0d1f..41f54c76 100644 --- a/NorthstarDLL/core/convar/concommand.cpp +++ b/NorthstarDLL/core/convar/concommand.cpp @@ -3,6 +3,7 @@ #include "engine/r2engine.h" #include "plugins/pluginbackend.h" +#include "plugins/plugin_abi.h" #include <iostream> @@ -151,5 +152,6 @@ ON_DLL_LOAD("engine.dll", ConCommand, (CModule module)) ConCommandConstructor = module.Offset(0x415F60).RCast<ConCommandConstructorType>(); AddMiscConCommands(); - g_pPluginCommunicationhandler->m_sEngineData.ConCommandConstructor = (void*)ConCommandConstructor; + g_pPluginCommunicationhandler->m_sEngineData.ConCommandConstructor = + reinterpret_cast<PluginConCommandConstructorType>(ConCommandConstructor); } diff --git a/NorthstarDLL/core/convar/convar.cpp b/NorthstarDLL/core/convar/convar.cpp index 9aaaca66..594989c2 100644 --- a/NorthstarDLL/core/convar/convar.cpp +++ b/NorthstarDLL/core/convar/convar.cpp @@ -4,6 +4,7 @@ #include "core/sourceinterface.h" #include "plugins/pluginbackend.h" +#include "plugins/plugin_abi.h" #include <float.h> @@ -40,10 +41,11 @@ ON_DLL_LOAD("engine.dll", ConVar, (CModule module)) R2::g_pCVarInterface = new SourceInterface<CCvar>("vstdlib.dll", "VEngineCvar007"); R2::g_pCVar = *R2::g_pCVarInterface; - g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = (void*)conVarMalloc; - g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = (void*)conVarRegister; - g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = (void*)g_pConVar_Vtable; - g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = (void*)g_pIConVar_Vtable; + g_pPluginCommunicationhandler->m_sEngineData.conVarMalloc = reinterpret_cast<PluginConVarMallocType>(conVarMalloc); + g_pPluginCommunicationhandler->m_sEngineData.conVarRegister = reinterpret_cast<PluginConVarRegisterType>(conVarRegister); + g_pPluginCommunicationhandler->m_sEngineData.ConVar_Vtable = reinterpret_cast<void*>(g_pConVar_Vtable); + g_pPluginCommunicationhandler->m_sEngineData.IConVar_Vtable = reinterpret_cast<void*>(g_pIConVar_Vtable); + g_pPluginCommunicationhandler->m_sEngineData.g_pCVar = reinterpret_cast<void*>(R2::g_pCVar); } //----------------------------------------------------------------------------- diff --git a/NorthstarDLL/core/hooks.cpp b/NorthstarDLL/core/hooks.cpp index 4363c0e2..da7f9f3e 100644 --- a/NorthstarDLL/core/hooks.cpp +++ b/NorthstarDLL/core/hooks.cpp @@ -1,4 +1,5 @@ #include "dedicated/dedicated.h" +#include "plugins/pluginbackend.h" #include <iostream> #include <wchar.h> @@ -409,7 +410,10 @@ HMODULE, WINAPI, (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)) moduleAddress = _LoadLibraryExA(lpLibFileName, hFile, dwFlags); if (moduleAddress) + { CallLoadLibraryACallbacks(lpLibFileName, moduleAddress); + InformPluginsDLLLoad(fs::path(lpLibFileName), moduleAddress); + } return moduleAddress; } @@ -448,7 +452,10 @@ HMODULE, WINAPI, (LPCWSTR lpLibFileName)) HMODULE moduleAddress = _LoadLibraryW(lpLibFileName); if (moduleAddress) + { CallLoadLibraryWCallbacks(lpLibFileName, moduleAddress); + InformPluginsDLLLoad(fs::path(lpLibFileName), moduleAddress); + } return moduleAddress; } |