mirror of
https://github.com/WinDurango/WinDurango.git
synced 2026-05-21 01:18:49 -05:00
27 lines
759 B
C++
27 lines
759 B
C++
#include "pch.h"
|
|
#include "hooks.h"
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID reserved)
|
|
{
|
|
if (DetourIsHelperProcess()) return TRUE;
|
|
|
|
if (dwReason == DLL_PROCESS_ATTACH)
|
|
{
|
|
DetourRestoreAfterWith();
|
|
DetourTransactionBegin();
|
|
DetourUpdateThread(GetCurrentThread());
|
|
DetourAttach(&reinterpret_cast<PVOID&>(TrueRoGetActivationFactory), RoGetActivationFactory_Hook);
|
|
|
|
DetourTransactionCommit();
|
|
}
|
|
else if (dwReason == DLL_PROCESS_DETACH)
|
|
{
|
|
DetourTransactionBegin();
|
|
DetourUpdateThread(GetCurrentThread());
|
|
DetourDetach(&reinterpret_cast<PVOID&>(TrueRoGetActivationFactory), RoGetActivationFactory_Hook);
|
|
DetourDetach(&TrueGetForCurrentThread, GetForCurrentThread_Hook);
|
|
DetourTransactionCommit();
|
|
}
|
|
|
|
return TRUE;
|
|
} |