NVDA Helper
In-process and lite high-speed utilities for NVDA
|
#include <iostream>
#include <set>
#include <windows.h>
#include <delayimp.h>
#include <detours/src/detours.h>
#include "log.h"
#include "apiHook.h"
Go to the source code of this file.
Macros | |
#define | WIN32_LEAN_AND_MEAN |
Typedefs | |
typedef set< pair< void **, void * > > | functionSet_t |
Functions | |
bool | apiHook_beginTransaction () |
Initializes an API hooking transaction. | |
bool | apiHook_hookFunction (void *realFunction, void *fakeFunction, void **targetPointerRef) |
Requests that the given function from the given module should be hooked with the given hook procedure. | |
bool | apiHook_commitTransaction () |
Commits an API hooking transaction. | |
bool | apiHook_terminate () |
unhooks all functions previously hooked with apiHook_hookFunction and terminates API hooking subsystem. | |
Variables | |
functionSet_t | g_hookedFunctions |
#define WIN32_LEAN_AND_MEAN |
typedef set<pair<void**, void*> > functionSet_t |
bool apiHook_beginTransaction | ( | ) |
Initializes an API hooking transaction.
References LOG_DEBUG, and LOG_ERROR.
Referenced by apiHook_terminate(), inprocMgrThreadFunc(), and nvdaHelperLocal_initialize().
Requests that the given function from the given module should be hooked with the given hook procedure.
Warning, this function has no safety checks, you should usually use the apiHook_hookFunction_safe template
realFunction | the function you wish to hook. |
fakeFunction | the function you wish to be called instead of the original one. |
targetPointerRef | Pointer variable that will contain a pointer to the original function after hooking. This is used to unhook. |
References g_hookedFunctions, LOG_DEBUG, and LOG_ERROR.
Referenced by apiHook_hookFunction_safe().
bool apiHook_commitTransaction | ( | ) |
Commits an API hooking transaction.
References LOG_DEBUG, and LOG_ERROR.
Referenced by apiHook_terminate(), inprocMgrThreadFunc(), and nvdaHelperLocal_initialize().
bool apiHook_terminate | ( | ) |
unhooks all functions previously hooked with apiHook_hookFunction and terminates API hooking subsystem.
References apiHook_beginTransaction(), apiHook_commitTransaction(), g_hookedFunctions, LOG_DEBUG, and LOG_ERROR.
Referenced by DllMain(), inprocMgrThreadFunc(), and nvdaHelperLocal_terminate().
functionSet_t g_hookedFunctions |
Referenced by apiHook_hookFunction(), and apiHook_terminate().