diff --git a/r5dev/thirdparty/detours/include/idetour.h b/r5dev/thirdparty/detours/include/idetour.h index 5c4b72f9..6f794679 100644 --- a/r5dev/thirdparty/detours/include/idetour.h +++ b/r5dev/thirdparty/detours/include/idetour.h @@ -15,6 +15,18 @@ public: virtual void Attach(void) const = 0; virtual void Detach(void) const = 0; + + //virtual void Detour(const bool bAttach) const = 0; + template< + typename T, + typename std::enable_if::value, int>::type = 0> + LONG Setup(_Inout_ T* ppPointer, _In_ T pDetour, const bool bAttach) const + { + if (bAttach) + return DetourAttach(ppPointer, pDetour); + else + return DetourDetach(ppPointer, pDetour); + } }; extern std::vector g_DetourVec; diff --git a/r5dev/thirdparty/detours/src/idetour.cpp b/r5dev/thirdparty/detours/src/idetour.cpp index 264ae8d3..bbd1de53 100644 --- a/r5dev/thirdparty/detours/src/idetour.cpp +++ b/r5dev/thirdparty/detours/src/idetour.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include "../include/detours.h" #include "../include/idetour.h" //-----------------------------------------------------------------------------