feat: added exports
This commit is contained in:
12
src/detail/exports.hpp
Normal file
12
src/detail/exports.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <fxn/context.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
typedef bool (*native_hook_t)(fxn::NativeContext* context, bool& call_original);
|
||||
|
||||
__declspec(dllexport) void* fxn_native_invoker_get_handler(std::uint64_t hash);
|
||||
__declspec(dllexport) void fxn_schedule_native(fxn::NativeContext* context, bool wait);
|
||||
__declspec(dllexport) void fxn_register_native_hook(std::uint64_t hash, native_hook_t hook);
|
||||
}
|
||||
29
src/impl/exports.cpp
Normal file
29
src/impl/exports.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <detail/exports.hpp>
|
||||
#include <detail/fxn.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllexport) void* fxn_native_invoker_get_handler(std::uint64_t hash)
|
||||
{
|
||||
static auto& manager = fxn::FxnManager::GetInstance();
|
||||
|
||||
return manager.GetNativeHandler(hash);
|
||||
}
|
||||
|
||||
__declspec(dllexport) void fxn_schedule_native(fxn::NativeContext* context, bool wait)
|
||||
{
|
||||
static auto& manager = fxn::FxnManager::GetInstance();
|
||||
|
||||
manager.Schedule(context, wait);
|
||||
}
|
||||
|
||||
__declspec(dllexport) void fxn_register_native_hook(std::uint64_t hash, native_hook_t hook)
|
||||
{
|
||||
static auto& manager = fxn::FxnManager::GetInstance();
|
||||
|
||||
manager.RegisterNativeHook(hash, [hook](fxn::NativeContext* context, bool& call_original)
|
||||
{
|
||||
return hook(context, call_original);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user