|
HydraHook
Direct3D and Core Audio hooking library for Windows
|
Internal engine structure and callback invocation macros. More...
Go to the source code of this file.
Classes | |
| class | ResettableOnce |
| Once-per-hook announcement guard that can be re-armed. More... | |
| struct | HYDRAHOOK_ENGINE |
| Internal engine instance structure (opaque in public API). More... | |
| struct | HYDRAHOOK_ENGINE::RenderPipelineState |
| struct | HookActivityTracker |
| Lock-free tracker for in-flight hook lambda invocations. More... | |
| struct | HookActivityTracker::Guard |
| RAII guard placed at the top of every hook lambda. More... | |
Namespaces | |
| namespace | spdlog |
Macros | |
| #define | INVOKE_HYDRAHOOK_GAME_HOOKED(_engine_, _version_) |
| Invokes EvtHydraHookGameHooked if non-NULL. | |
| #define | INVOKE_D3D9_CALLBACK(_engine_, _callback_, ...) |
| Invokes D3D9 callback if registered. | |
| #define | INVOKE_D3D10_CALLBACK(_engine_, _callback_, ...) |
| Invokes D3D10 callback if registered. | |
| #define | INVOKE_D3D11_CALLBACK(_engine_, _callback_, ...) |
| Invokes D3D11 callback if registered. | |
| #define | INVOKE_D3D12_CALLBACK(_engine_, _callback_, ...) |
| Invokes D3D12 callback if registered. | |
| #define | INVOKE_ARC_CALLBACK(_engine_, _callback_, ...) |
| Invokes Core Audio callback if registered. | |
Functions | |
| template<typename T, typename U> | |
| void | StoreRenderPipelinePtr (std::atomic< T * > &slot, U *value) |
| Publishes a RenderPipeline pointer. Render threads write it while other threads look engines up by it (HydraHookEngineGetHandleFrom*), so every access goes through these. | |
| template<typename Pipeline> | |
| void | ClearRenderPipeline (Pipeline &pipeline) |
| Resets every RenderPipeline pointer atomically, so concurrent lookups never see a torn value. | |
| template<typename T> | |
| T * | LoadRenderPipelinePtr (const std::atomic< T * > &slot) |
| bool | HydraHookPinWorkerModule () |
| Pins the module that contains this engine for the rest of the process. | |
| void | HydraHookLoggingEnableAsync () |
| Swaps the process logger to a HydraHook-owned async pool. Call from the worker, not DllMain. | |
| void | HydraHookLoggingDisableAsync () |
| Flushes, restores the sync logger, and joins the async pool. Call from the worker, not DllMain. | |
| std::shared_ptr< spdlog::logger > | HydraHookCloneRegisteredLogger (const char *channel) |
| Clones the registered HYDRAHOOK logger; replacement cannot drop it during this call. Do not call from DllMain: this takes a blocking host-logger lock and may post through async_logger. | |
| HYDRAHOOK_ERROR | HydraHookEngineDestroyBeforeUnload (HMODULE host, bool(*detachFreeLibraryHook)() noexcept) |
| Tears down the registered engine before explicit unload. Busy failures keep the hook installed. | |
Internal engine structure and callback invocation macros.
Defines the opaque HYDRAHOOK_ENGINE layout and macros for invoking version-specific callbacks. Internal use only; not part of public API.
Definition in file Engine.h.
| #define INVOKE_ARC_CALLBACK | ( | _engine_, | |
| _callback_, | |||
| ... ) |
| #define INVOKE_D3D10_CALLBACK | ( | _engine_, | |
| _callback_, | |||
| ... ) |
| #define INVOKE_D3D11_CALLBACK | ( | _engine_, | |
| _callback_, | |||
| ... ) |
| #define INVOKE_D3D12_CALLBACK | ( | _engine_, | |
| _callback_, | |||
| ... ) |
| #define INVOKE_D3D9_CALLBACK | ( | _engine_, | |
| _callback_, | |||
| ... ) |
Invokes D3D9 callback if registered.
Definition at line 267 of file Engine.h.
Referenced by HydraHookMainThread().
| #define INVOKE_HYDRAHOOK_GAME_HOOKED | ( | _engine_, | |
| _version_ ) |
Invokes EvtHydraHookGameHooked if non-NULL.
Definition at line 257 of file Engine.h.
Referenced by HydraHookMainThread().
|
inline |
Resets every RenderPipeline pointer atomically, so concurrent lookups never see a torn value.
Definition at line 152 of file Engine.h.
References ClearRenderPipeline().
Referenced by ClearRenderPipeline(), HydraHookEngineRehook(), and HydraHookEngineUnhook().
| std::shared_ptr< spdlog::logger > HydraHookCloneRegisteredLogger | ( | const char * | channel | ) |
Clones the registered HYDRAHOOK logger; replacement cannot drop it during this call. Do not call from DllMain: this takes a blocking host-logger lock and may post through async_logger.
Definition at line 1059 of file Engine.cpp.
References HydraHookCloneRegisteredLogger().
Referenced by DestroyEngine(), HydraHookCloneRegisteredLogger(), and PerformShutdownCleanup().
| HYDRAHOOK_ERROR HydraHookEngineDestroyBeforeUnload | ( | HMODULE | host, |
| bool(* | detachFreeLibraryHook )() noexcept ) |
Tears down the registered engine before explicit unload. Busy failures keep the hook installed.
Definition at line 573 of file Engine.cpp.
References DestroyEngine(), and HydraHookEngineDestroyBeforeUnload().
Referenced by HydraHookEngineDestroyBeforeUnload(), and HydraHookMainThread().
| void HydraHookLoggingDisableAsync | ( | ) |
Flushes, restores the sync logger, and joins the async pool. Call from the worker, not DllMain.
Definition at line 1016 of file Engine.cpp.
References HydraHookLoggingDisableAsync().
Referenced by HydraHookLoggingDisableAsync().
| void HydraHookLoggingEnableAsync | ( | ) |
Swaps the process logger to a HydraHook-owned async pool. Call from the worker, not DllMain.
Definition at line 961 of file Engine.cpp.
References HydraHookLoggingEnableAsync().
Referenced by HydraHookLoggingEnableAsync(), and HydraHookMainThread().
| bool HydraHookPinWorkerModule | ( | ) |
Pins the module that contains this engine for the rest of the process.
Definition at line 150 of file Engine.cpp.
References HydraHookPinWorkerModule().
Referenced by HydraHookPinWorkerModule().
|
inline |
Definition at line 160 of file Engine.h.
References LoadRenderPipelinePtr().
Referenced by HydraHookEngineGetHandleFromD3D10SwapChain(), HydraHookEngineGetHandleFromD3D9Device(), HydraHookEngineGetHandleFromD3D9ExDevice(), and LoadRenderPipelinePtr().
|
inline |
Publishes a RenderPipeline pointer. Render threads write it while other threads look engines up by it (HydraHookEngineGetHandleFrom*), so every access goes through these.
Definition at line 143 of file Engine.h.
References StoreRenderPipelinePtr().
Referenced by HydraHookMainThread(), and StoreRenderPipelinePtr().