HydraHook
Direct3D and Core Audio hooking library for Windows
Loading...
Searching...
No Matches
Game.h
Go to the documentation of this file.
1
11
12/*
13MIT License
14
15Copyright (c) 2018-2026 Benjamin Höglinger-Stelzer
16
17Permission is hereby granted, free of charge, to any person obtaining a copy
18of this software and associated documentation files (the "Software"), to deal
19in the Software without restriction, including without limitation the rights
20to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21copies of the Software, and to permit persons to whom the Software is
22furnished to do so, subject to the following conditions:
23
24The above copyright notice and this permission notice shall be included in all
25copies or substantial portions of the Software.
26
27THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33SOFTWARE.
34*/
35
36#pragma once
37
38#include <Windows.h>
40
41struct IDXGISwapChain;
42struct ID3D12CommandQueue;
43struct IUnknown;
44
45// Only constructed by the D3D12 ResizeBuffers/ResizeBuffers1 dispatchers.
50
51// Track the live extension so the public deferral API never downcasts arbitrary input.
53{
54 inline static thread_local D3D12ResizePreExtension* Current = nullptr;
55
56 explicit D3D12ResizeCallbackScope(D3D12ResizePreExtension& extension) noexcept : previous(Current)
57 {
58 Current = &extension;
59 }
63
64private:
66};
67
68#ifndef HYDRAHOOK_NO_D3D12
69inline thread_local bool g_suppressD3D12QueueCapture = false;
70
83#endif
84
85ID3D12CommandQueue* GetUniformD3D12PresentQueue(UINT bufferCount, IUnknown* const* presentQueues);
86
97ID3D12CommandQueue* GetD3D12CommandQueueForSwapChain(IDXGISwapChain* pSwapChain, bool requireVerifiedQueue = false);
98
111DWORD WINAPI HydraHookMainThread(LPVOID Params);
ID3D12CommandQueue * GetUniformD3D12PresentQueue(UINT bufferCount, IUnknown *const *presentQueues)
Definition Game.cpp:2077
ID3D12CommandQueue * GetD3D12CommandQueueForSwapChain(IDXGISwapChain *pSwapChain, bool requireVerifiedQueue)
Returns the D3D12 command queue associated with a swap chain.
Definition Game.cpp:2188
DWORD HydraHookMainThread(LPVOID Params)
Main hook worker thread; probes and hooks render and audio APIs.
Definition Game.cpp:451
bool g_suppressD3D12QueueCapture
Definition Game.h:69
Core engine API for HydraHook - Direct3D and Core Audio hooking library.
D3D12ResizeCallbackScope(const D3D12ResizeCallbackScope &)=delete
static D3D12ResizePreExtension * Current
Definition Game.h:54
D3D12ResizeCallbackScope & operator=(const D3D12ResizeCallbackScope &)=delete
D3D12ResizeCallbackScope(D3D12ResizePreExtension &extension) noexcept
Definition Game.h:56
Extension data passed to pre-hook event callbacks (D3D11/12, Core Audio).
ScopedSuppressD3D12QueueCapture(const ScopedSuppressD3D12QueueCapture &)=delete
ScopedSuppressD3D12QueueCapture & operator=(const ScopedSuppressD3D12QueueCapture &)=delete
ScopedSuppressD3D12QueueCapture() noexcept
Definition Game.h:75