NVDA Helper
In-process and lite high-speed utilities for NVDA
dllImportTableHooks.cpp File Reference
#include <cstdio>
#include <string.h>
#include "dllImportTableHooks.h"
#include <common\log.h>
#include <shlwapi.h>
#include <psapi.h>

Go to the source code of this file.

Functions

voiddllImportTableHooks_hookSingle (char *targetDll, char *importDll, char *funcName, void *newFunction)
 Hooks a single imported function in a dll.
 
void dllImportTableHooks_unhookSingle (void *hook)
 Unhooks a previously hooked function hooked by dllImportTableHooks_hookSingle.
 

Function Documentation

◆ dllImportTableHooks_hookSingle()

void * dllImportTableHooks_hookSingle ( char * targetDll,
char * importDll,
char * functionName,
void * newFunction )

Hooks a single imported function in a dll.

Uses the DllImportTableHook class.

Parameters
targetDllthe name of the dll who has imported the function to be hooked.
importDllthe name of the dll containing the function imported.
functionNameThe name of the function to be hooked.
newFunctionthe function to be called instead.
Returns
an opaque pointer to the DllImportTableHook class instance that hooked the function.

References DllImportTableHooks::hookFunctions(), and DllImportTableHooks::requestFunctionHook().

◆ dllImportTableHooks_unhookSingle()

void dllImportTableHooks_unhookSingle ( void * hook)

Unhooks a previously hooked function hooked by dllImportTableHooks_hookSingle.

Parameters
hookThe opaque pointer returned from a ccessful call to dllImportTableHooks_hookSingle.

References DllImportTableHooks::targetModule, and DllImportTableHooks::unhookFunctions().