|
HydraHook
Direct3D and Core Audio hooking library for Windows
|
Internal crash handler installation and teardown. More...
#include "HydraHook/Engine/HydraHookCore.h"Go to the source code of this file.
Functions | |
| bool | HydraHookCrashHandlerInstall (PHYDRAHOOK_ENGINE engine) |
| Installs global crash handlers (ref-counted) for the given engine. | |
| void | HydraHookCrashHandlerUninstall (PHYDRAHOOK_ENGINE engine) |
| Decrements the crash handler reference count. | |
| void | HydraHookCrashHandlerInstallThreadSEH () |
| Installs the per-thread SEH-to-C++ translator on the calling thread. | |
| PHYDRAHOOK_ENGINE | HydraHookCrashHandlerActiveOwnerForTest () |
| Test accessor. Returns the engine that owns the published crash snapshot. | |
| bool | HydraHookCrashHandlerReferencesEngine (PHYDRAHOOK_ENGINE engine) |
| True when a published or deferred snapshot still names this engine. Destroy must not free the engine while this is true. | |
Internal crash handler installation and teardown.
Provides process-wide (reference-counted) and per-thread crash handling for field debugging. Not part of the public API.
Definition in file CrashHandler.h.
| PHYDRAHOOK_ENGINE HydraHookCrashHandlerActiveOwnerForTest | ( | ) |
Test accessor. Returns the engine that owns the published crash snapshot.
Definition at line 600 of file CrashHandler.cpp.
References HydraHookCrashHandlerActiveOwnerForTest(), CrashConfigSnapshot::OwnerEngine, s_installMutex, and s_snapshot.
Referenced by HydraHookCrashHandlerActiveOwnerForTest().
| bool HydraHookCrashHandlerInstall | ( | PHYDRAHOOK_ENGINE | engine | ) |
Installs global crash handlers (ref-counted) for the given engine.
On first call: registers SetUnhandledExceptionFilter, set_terminate, _set_invalid_parameter_handler, and _set_purecall_handler. Subsequent calls increment the reference count without re-installing.
| engine | Engine whose CrashHandler config controls dump output. |
engine is null or the snapshot could not be registered. Definition at line 490 of file CrashHandler.cpp.
References HydraHookCrashHandlerInstall(), HydraHookInvalidParameterHandler(), HydraHookPurecallHandler(), HydraHookTerminateHandler(), HydraHookUnhandledExceptionFilter(), MakeSnapshot(), ReapDeferredSnapshots(), RetireSnapshot(), s_installMutex, s_prevInvalidParamHandler, s_prevPurecallHandler, s_prevTerminateHandler, s_prevUnhandledFilter, s_refCount, s_registrations, and s_snapshot.
Referenced by HydraHookCrashHandlerInstall(), and HydraHookEngineCreate().
| void HydraHookCrashHandlerInstallThreadSEH | ( | ) |
Installs the per-thread SEH-to-C++ translator on the calling thread.
Must be called from the engine worker thread. Bridges Win32 structured exceptions into HydraHook::Core::Exceptions::SehException so that existing try/catch blocks can catch hardware faults.
Definition at line 595 of file CrashHandler.cpp.
References HydraHookCrashHandlerInstallThreadSEH(), and HydraHookSehTranslator().
Referenced by HydraHookCrashHandlerInstallThreadSEH(), and HydraHookMainThread().
| bool HydraHookCrashHandlerReferencesEngine | ( | PHYDRAHOOK_ENGINE | engine | ) |
True when a published or deferred snapshot still names this engine. Destroy must not free the engine while this is true.
Definition at line 607 of file CrashHandler.cpp.
References HydraHookCrashHandlerReferencesEngine(), CrashConfigSnapshot::OwnerEngine, ReapDeferredSnapshots(), s_deferredSnapshots, s_installMutex, and s_snapshot.
Referenced by DestroyEngine(), HydraHookCrashHandlerReferencesEngine(), and HydraHookEngineCreate().
| void HydraHookCrashHandlerUninstall | ( | PHYDRAHOOK_ENGINE | engine | ) |
Decrements the crash handler reference count.
If the uninstalling engine owns the active crash config snapshot, the next surviving registration is published. The previous snapshot is deleted only after in-flight dump writers have finished. When the last engine uninstalls, restores all previous handlers.
| engine | The engine that is being destroyed. |
Definition at line 530 of file CrashHandler.cpp.
References HydraHookCrashHandlerUninstall(), ReapDeferredSnapshots(), RetireSnapshot(), s_installMutex, s_prevInvalidParamHandler, s_prevPurecallHandler, s_prevTerminateHandler, s_prevUnhandledFilter, s_refCount, s_registrations, and s_snapshot.
Referenced by DestroyEngine(), HydraHookCrashHandlerUninstall(), and HydraHookEngineCreate().