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