NVDA Helper
In-process and lite high-speed utilities for NVDA
DllImportTableHooks Class Reference

#include <dllImportTableHooks.h>

Public Member Functions

 DllImportTableHooks (HMODULE targetModule)
 
voidrequestFunctionHook (const char *moduleName, const char *functionName, void *newHookProc)
 Requests that the given function from the given module should be hooked with the given hook procedure.
 
BOOL hookFunctions ()
 Hooks all the functions requested with requestFunctionHook.
 
BOOL unhookFunctions ()
 Unhooks any functions previously hooked.
 

Public Attributes

const HMODULE targetModule
 

Detailed Description

Constructor & Destructor Documentation

◆ DllImportTableHooks()

DllImportTableHooks::DllImportTableHooks ( HMODULE targetModule)

Member Function Documentation

◆ requestFunctionHook()

void * DllImportTableHooks::requestFunctionHook ( const char * moduleName,
const char * functionName,
void * newHookProc )

Requests that the given function from the given module should be hooked with the given hook procedure.

Note that hooking does not automatically take place when this function is called, so this function can be called many times before the actual hooking can be done in bulk with apiHooks_hookFunctions.

Parameters
moduleNamethe name of the module the function you wish to hook is located in.
functionNamethe name of the function you wish to hook.
newHookProcthe function you wish to be called instead of the original one.
Returns
the address of the original function. You could use this to call the origianl function from with in your replacement.

References LOG_DEBUG, and LOG_ERROR.

Referenced by dllImportTableHooks_hookSingle().

◆ hookFunctions()

BOOL DllImportTableHooks::hookFunctions ( )

Hooks all the functions requested with requestFunctionHook.

Returns
true if it succeeded, false otherwize.

References LOG_DEBUG, LOG_ERROR, and targetModule.

Referenced by dllImportTableHooks_hookSingle().

◆ unhookFunctions()

BOOL DllImportTableHooks::unhookFunctions ( )

Unhooks any functions previously hooked.

References LOG_DEBUG, and targetModule.

Referenced by dllImportTableHooks_unhookSingle().

Member Data Documentation

◆ targetModule

const HMODULE DllImportTableHooks::targetModule

The documentation for this class was generated from the following files: