forked from winfsp/winspd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
injection.h
30 lines (27 loc) · 854 Bytes
/
injection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* @file tlib/injection.h
*
* @copyright 2014-2019 Bill Zissimopoulos
*/
/* NOTE: This header may usefully be included multiple times.
* The TLIB_INJECT() macro will be redefined based on whether
* TLIB_INJECTIONS_ENABLED is defined.
*/
#undef TLIB_INJECT
#if defined(TLIB_INJECTIONS_ENABLED)
#define TLIB_INJECT(name, stmt) \
do\
{\
static void *injection = 0;\
if (0 == injection)\
injection = tlib_injection(name);\
if (tlib_injection_trace(injection))\
stmt;\
} while (0)
#else
#define TLIB_INJECT(name, stmt) do {} while (0)
#endif
void *tlib_injection(const char *name);
int tlib_injection_trace(void *injection);
void tlib_injection_enable(const char *name, const char *sym, unsigned trigger);
void tlib_injection_disable(const char *name, const char *sym);