MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / HookAPI

Function HookAPI

IntelPresentMon/FlashInjectorLibrary/Hooks/Hooks.cpp:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 bool HookAPI(const std::string& name, PVOID* ppRealFn, PVOID pMineFn)
21 {
22 Initialize();
23
24 DetourTransactionBegin();
25 DetourUpdateThread(GetCurrentThread());
26 DetourAttach(ppRealFn, pMineFn);
27
28 if (DetourTransactionCommit() != NO_ERROR)
29 {
30 LOGE << "Error hooking API call: " << name;
31 return false;
32 }
33
34 LOGI << "Hooked API call: " << name;
35 return true;
36 }
37
38 bool UnhookAPI(const std::string& name, PVOID* ppRealFn, PVOID pMineFn)
39 {

Callers 1

AttachMethod · 0.85

Calls 1

InitializeFunction · 0.70

Tested by

no test coverage detected