mirror of
https://github.com/SteamAutoCracks/DepotDownloaderMod.git
synced 2026-02-14 05:40:57 +01:00
34 lines
573 B
C++
34 lines
573 B
C++
|
|
#include "csimpledetour.h"
|
|
|
|
|
|
CSimpleDetour::CSimpleDetour(void **old, void *replacement)
|
|
{
|
|
m_fnOld = old;
|
|
m_fnReplacement = replacement;
|
|
}
|
|
|
|
void CSimpleDetour::Attach()
|
|
{
|
|
DetourTransactionBegin();
|
|
DetourUpdateThread(GetCurrentThread());
|
|
|
|
DetourAttach(m_fnOld, m_fnReplacement);
|
|
|
|
DetourTransactionCommit();
|
|
|
|
m_bAttached = true;
|
|
}
|
|
|
|
void CSimpleDetour::Detach()
|
|
{
|
|
if (!m_bAttached)
|
|
return;
|
|
|
|
DetourTransactionBegin();
|
|
DetourUpdateThread(GetCurrentThread());
|
|
|
|
DetourDetach(m_fnOld, m_fnReplacement);
|
|
|
|
DetourTransactionCommit();
|
|
} |