HydraHook
Direct3D and Core Audio hooking library for Windows
Loading...
Searching...
No Matches
EngineIpc.cpp File Reference

Shared-memory engine status block and thread-pool rehook wait. More...

#include <Windows.h>
#include "HydraHook/Engine/HydraHookCore.h"
#include "HydraHook/Engine/HydraHookDirect3D9.h"
#include "HydraHook/Engine/HydraHookDirect3D10.h"
#include "HydraHook/Engine/HydraHookDirect3D11.h"
#include "HydraHook/Engine/HydraHookDirect3D12.h"
#include "HydraHook/Engine/HydraHookCoreAudio.h"
#include "EngineIpc.h"
#include "Engine.h"
#include "Utils/SrwLock.h"
#include <spdlog/spdlog.h>
#include <cstring>

Go to the source code of this file.

Macros

#define WIN32_LEAN_AND_MEAN

Functions

void HydraHookIpcCreate (PHYDRAHOOK_ENGINE engine)
void HydraHookIpcPublish (PHYDRAHOOK_ENGINE engine, std::uint32_t state, std::uint32_t origin, std::uint32_t gameVersion, std::uint32_t flags)
void HydraHookIpcPublishRunning (PHYDRAHOOK_ENGINE engine)
 Moves Initializing to Running. Does not write the graphics API a Hooked publish owns.
void HydraHookIpcArmRehookWait (PHYDRAHOOK_ENGINE engine)
void HydraHookIpcDisarmRehookWait (PHYDRAHOOK_ENGINE engine)
bool HydraHookIpcAbandonRehookWait (PHYDRAHOOK_ENGINE engine)
 Cancels a pending rehook wait so the engine can be freed.
void HydraHookIpcClose (PHYDRAHOOK_ENGINE engine)
 Closes IPC objects. The caller guarantees no rehook callback is running.

Variables

std::atomic< HydraHookIpcRehookHold > HydraHookIpcRehookHoldForTest {nullptr}

Detailed Description

Shared-memory engine status block and thread-pool rehook wait.

Definition in file EngineIpc.cpp.

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 9 of file EngineIpc.cpp.

Function Documentation

◆ HydraHookIpcAbandonRehookWait()

bool HydraHookIpcAbandonRehookWait ( PHYDRAHOOK_ENGINE engine)

Cancels a pending rehook wait so the engine can be freed.

Returns
false when a rehook callback is queued or running. The caller must keep the engine.

Definition at line 390 of file EngineIpc.cpp.

References HydraHookIpcAbandonRehookWait(), HydraHookIpcPhaseArmed, and HydraHookIpcPhaseIdle.

Referenced by DestroyEngine(), and HydraHookIpcAbandonRehookWait().

◆ HydraHookIpcArmRehookWait()

◆ HydraHookIpcClose()

void HydraHookIpcClose ( PHYDRAHOOK_ENGINE engine)

Closes IPC objects. The caller guarantees no rehook callback is running.

Definition at line 419 of file EngineIpc.cpp.

References HydraHookIpcClose().

Referenced by DestroyEngine(), HydraHookEngineCreate(), and HydraHookIpcClose().

◆ HydraHookIpcCreate()

◆ HydraHookIpcDisarmRehookWait()

void HydraHookIpcDisarmRehookWait ( PHYDRAHOOK_ENGINE engine)

◆ HydraHookIpcPublish()

void HydraHookIpcPublish ( PHYDRAHOOK_ENGINE engine,
std::uint32_t state,
std::uint32_t origin,
std::uint32_t gameVersion,
std::uint32_t flags )

◆ HydraHookIpcPublishRunning()

void HydraHookIpcPublishRunning ( PHYDRAHOOK_ENGINE engine)

Moves Initializing to Running. Does not write the graphics API a Hooked publish owns.

Definition at line 264 of file EngineIpc.cpp.

References HydraHookIpcPublishRunning(), HydraHookIpcStateInitializing, and HydraHookIpcStateRunning.

Referenced by HydraHookIpcPublishRunning().

Variable Documentation

◆ HydraHookIpcRehookHoldForTest

std::atomic<HydraHookIpcRehookHold> HydraHookIpcRehookHoldForTest {nullptr}

Test seam. Invoked after a successful rehook callback starts the worker and before it releases the phase.

Definition at line 27 of file EngineIpc.cpp.