-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathd3d9_hook.h
More file actions
23 lines (19 loc) · 784 Bytes
/
d3d9_hook.h
File metadata and controls
23 lines (19 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include <d3d9.h>
#include <memory>
// Function typedefs
typedef HRESULT(__stdcall* EndScene_t)(LPDIRECT3DDEVICE9);
typedef HRESULT(__stdcall* Reset_t)(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
// Global variables
extern LPDIRECT3DDEVICE9 g_pd3dDevice;
extern EndScene_t original_EndScene;
extern Reset_t original_Reset;
extern WNDPROC original_WndProc;
extern HWND g_hookedWindow;
bool InitializeD3D9Hook();
void CleanupD3D9Hook();
// Hook functions
HRESULT __stdcall HookedEndScene(LPDIRECT3DDEVICE9 pDevice);
HRESULT __stdcall HookedReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
LRESULT CALLBACK HookedWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);