Files
WinDurango/dlls/kernelx/dllmain.cpp
T

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;
}