102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
watchdog.c File Reference
#include <dttr_config.h>
#include <dttr_crashdump.h>
#include <dttr_errors.h>
#include <dttr_loader.h>
#include <dttr_log.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <windows.h>

Go to the source code of this file.

Typedefs

typedef BOOL(* is_wow64_process2_fn) (HANDLE, USHORT *, USHORT *)

Enumerations

enum  { WATCHDOG_TIMEOUT_MS = 30000 }

Functions

static void detach_watchdog (DWORD process_id)
static bool should_disable_watchdog ()
static void write_child_dump (HANDLE process, DWORD pid, DWORD tid, DWORD exception_code)
void DTTR_Loader_WatchdogAttach (const PROCESS_INFORMATION *child_info)
void DTTR_Loader_WatchdogDetach (const PROCESS_INFORMATION *child_info)
static bool is_sentinel (HANDLE process, const OUTPUT_DEBUG_STRING_INFO *info)
bool DTTR_Loader_WatchdogWait (const PROCESS_INFORMATION *child_info)

Variables

static const char WATCHDOG_SENTINEL [] = "DTTR_SIDECAR_ENTRYPOINT"
static bool watchdog_attached = false

Typedef Documentation

◆ is_wow64_process2_fn

typedef BOOL(* is_wow64_process2_fn) (HANDLE, USHORT *, USHORT *)

Definition at line 14 of file watchdog.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WATCHDOG_TIMEOUT_MS 

Definition at line 11 of file watchdog.c.

Function Documentation

◆ detach_watchdog()

void detach_watchdog ( DWORD process_id)
static

Definition at line 18 of file watchdog.c.

References DTTR_LOG_DEBUG, DWORD, and watchdog_attached.

Referenced by DTTR_Loader_WatchdogDetach(), and DTTR_Loader_WatchdogWait().

◆ DTTR_Loader_WatchdogAttach()

void DTTR_Loader_WatchdogAttach ( const PROCESS_INFORMATION * child_info)

Definition at line 115 of file watchdog.c.

References DTTR_LOG_DEBUG, DTTR_LOG_WARN, should_disable_watchdog(), and watchdog_attached.

Referenced by dttr_launcher_main().

◆ DTTR_Loader_WatchdogDetach()

void DTTR_Loader_WatchdogDetach ( const PROCESS_INFORMATION * child_info)

Definition at line 137 of file watchdog.c.

References detach_watchdog().

Referenced by dttr_launcher_main().

◆ DTTR_Loader_WatchdogWait()

bool DTTR_Loader_WatchdogWait ( const PROCESS_INFORMATION * child_info)

◆ is_sentinel()

bool is_sentinel ( HANDLE process,
const OUTPUT_DEBUG_STRING_INFO * info )
static

Definition at line 141 of file watchdog.c.

References WATCHDOG_SENTINEL.

Referenced by DTTR_Loader_WatchdogWait().

◆ should_disable_watchdog()

bool should_disable_watchdog ( )
static

Definition at line 28 of file watchdog.c.

References DTTR_LOG_DEBUG, and NULL.

Referenced by DTTR_Loader_WatchdogAttach().

◆ write_child_dump()

Variable Documentation

◆ watchdog_attached

bool watchdog_attached = false
static

◆ WATCHDOG_SENTINEL

const char WATCHDOG_SENTINEL[] = "DTTR_SIDECAR_ENTRYPOINT"
static

Definition at line 12 of file watchdog.c.

Referenced by is_sentinel().