dc1fe317f4807b50c01cda60be70e2384a949f0e
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Ancillary Function Driver
4 * FILE: include/debug.h
5 * PURPOSE: Debugging support macros
6 * DEFINES: DBG - Enable debug output
7 * NASSERT - Disable assertions
12 #define NORMAL_MASK 0x000000FF
13 #define SPECIAL_MASK 0xFFFFFF00
14 #define MIN_TRACE 0x00000001
15 #define MID_TRACE 0x00000002
16 #define MAX_TRACE 0x00000003
18 #define DEBUG_CHECK 0x00000100
19 #define DEBUG_IRP 0x00000200
20 #define DEBUG_ULTRA 0xFFFFFFFF
24 extern DWORD DebugTraceLevel
;
28 #define AFD_DbgPrint(_t_, _x_) \
29 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
30 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
31 DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
37 #define AFD_DbgPrint(_t_, _x_) \
38 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
39 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
40 DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
53 #define ASSERT(x) if (!(x)) { AFD_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
56 #define ASSERT_KM(x) ASSERT((x) >= 0xC0000000)
57 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
61 #define AFD_DbgPrint(_t_, _x_)
63 #define ASSERT_IRQL(x)
70 #define assert(x) ASSERT(x)
71 #define assert_km(x) ASSERT_KM(x)
72 #define assert_irql(x) ASSERT_IRQL(x)
77 #define UNIMPLEMENTED \
78 AFD_DbgPrint(MIN_TRACE, ("The function at %s:%d is unimplemented, \
79 but come back another day.\n", __FILE__, __LINE__));
83 #define UNIMPLEMENTED \
84 AFD_DbgPrint(MIN_TRACE, ("%s at %s:%d is unimplemented, " \
85 "but come back another day.\n", __FUNCTION__, __FILE__, __LINE__));
91 AFD_DbgPrint(DEBUG_CHECK, ("\n"));
95 #endif /* __DEBUG_H */