102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
hooks.c File Reference
#include <dttr_pcdogs.h>
#include <stdlib.h>
#include <windows.h>
#include <dttr_config.h>
#include "graphics_com_private.h"
#include "graphics_private.h"
#include "hooks_private.h"
#include "sidecar_private.h"
#include <dttr_log.h>

Go to the source code of this file.

Functions

static DTTR_Graphics_COM_DirectDraw7get_or_create_ddraw7 ()
static void store_pointer (void **slot, void *value)
HRESULT dttr_hook_directdraw_create_ex_callback (DTTR_PCDOGS_T_Win32_GUID *guid, void **ddraw_out, DTTR_PCDOGS_T_Win32_GUID *iid, DTTR_PCDOGS_T_COM_IUnknown *outer)
HRESULT dttr_hook_directdraw_enumerate_ex_a_callback (DDraw_EnumCallbackExA lpCallback, LPVOID lpContext, DWORD dwFlags)
bool dttr_graphics_hooks_init (const DTTR_Mods_Context *ctx)
void dttr_graphics_hooks_cleanup (const DTTR_Mods_Context *ctx)

Variables

static DTTR_Graphics_COM_DirectDraw7graphics_hook_ddraw7
static HWND graphics_hook_hwnd
static const DTTR_PCDOGS_T_Patch_Spec graphics_byte_patches []
static DTTR_Core_PatchGroupgraphics_import_thunk_patch_group
static DTTR_Core_PatchGroupgraphics_byte_patch_group

Function Documentation

◆ dttr_graphics_hooks_cleanup()

void dttr_graphics_hooks_cleanup ( const DTTR_Mods_Context * ctx)

◆ dttr_graphics_hooks_init()

◆ dttr_hook_directdraw_create_ex_callback()

◆ dttr_hook_directdraw_enumerate_ex_a_callback()

HRESULT dttr_hook_directdraw_enumerate_ex_a_callback ( DDraw_EnumCallbackExA lpCallback,
LPVOID lpContext,
DWORD dwFlags )

Definition at line 168 of file hooks.c.

References DTTR_LOG_DEBUG, DWORD, NULL, and S_OK.

Referenced by dttr_graphics_hooks_init().

◆ get_or_create_ddraw7()

◆ store_pointer()

void store_pointer ( void ** slot,
void * value )
static

Definition at line 116 of file hooks.c.

References DTTR_LOG_ERROR, and DWORD.

Referenced by dttr_hook_directdraw_create_ex_callback().

Variable Documentation

◆ graphics_byte_patch_group

DTTR_Core_PatchGroup* graphics_byte_patch_group
static

Definition at line 103 of file hooks.c.

Referenced by dttr_graphics_hooks_cleanup(), and dttr_graphics_hooks_init().

◆ graphics_byte_patches

const DTTR_PCDOGS_T_Patch_Spec graphics_byte_patches[]
static

Definition at line 17 of file hooks.c.

Referenced by dttr_graphics_hooks_init().

◆ graphics_hook_ddraw7

DTTR_Graphics_COM_DirectDraw7* graphics_hook_ddraw7
static

Definition at line 14 of file hooks.c.

Referenced by dttr_graphics_hooks_cleanup(), and get_or_create_ddraw7().

◆ graphics_hook_hwnd

HWND graphics_hook_hwnd
static

Definition at line 15 of file hooks.c.

Referenced by dttr_graphics_hooks_init().

◆ graphics_import_thunk_patch_group

DTTR_Core_PatchGroup* graphics_import_thunk_patch_group
static

Definition at line 102 of file hooks.c.

Referenced by dttr_graphics_hooks_cleanup(), and dttr_graphics_hooks_init().