- Implement EnumServicesStatusW.
[reactos.git] / reactos / drivers / lib / oskittcp / include / oskitdebug.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/debug.h
5 * PURPOSE: Debugging support macros
6 * DEFINES: DBG - Enable debug output
7 * NASSERT - Disable assertions
8 */
9 #ifndef __OSKITDEBUG_H
10 #define __OSKITDEBUG_H
11
12 #define OSK_NORMAL_MASK 0x000000FF
13 #define OSK_SPECIAL_MASK 0xFFFFFF00
14 #define OSK_MIN_TRACE 0x00000001
15 #define OSK_MID_TRACE 0x00000002
16 #define OSK_MAX_TRACE 0x00000003
17
18 #define OSK_DEBUG_CHECK 0x00000100
19 #define OSK_DEBUG_MEMORY 0x00000200
20 #define OSK_DEBUG_BUFFER 0x00000400
21 #define OSK_DEBUG_IRP 0x00000800
22 #define OSK_DEBUG_REFCOUNT 0x00001000
23 #define OSK_DEBUG_ADDRFILE 0x00002000
24 #define OSK_DEBUG_DATALINK 0x00004000
25 #define OSK_DEBUG_ARP 0x00008000
26 #define OSK_DEBUG_IP 0x00010000
27 #define OSK_DEBUG_UDP 0x00020000
28 #define OSK_DEBUG_TCP 0x00040000
29 #define OSK_DEBUG_ICMP 0x00080000
30 #define OSK_DEBUG_ROUTER 0x00100000
31 #define OSK_DEBUG_RCACHE 0x00200000
32 #define OSK_DEBUG_NCACHE 0x00400000
33 #define OSK_DEBUG_CPOINT 0x00800000
34 #define OSK_DEBUG_ULTRA 0xFFFFFFFF
35
36 #ifndef _MSC_VER
37 #include <roscfg.h>
38 #endif/*_MSC_VER*/
39 #include <oskittypes.h>
40
41 #ifdef DBG
42
43 extern OSK_UINT OskitDebugTraceLevel;
44
45 #ifdef _MSC_VER
46
47 #define OS_DbgPrint(_t_, _x_) \
48 if (((OskitDebugTraceLevel & OSK_NORMAL_MASK) >= _t_) || \
49 ((OskitDebugTraceLevel & _t_) > OSK_NORMAL_MASK)) { \
50 DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
51 DbgPrint _x_ ; \
52 }
53
54 #else /* _MSC_VER */
55
56 #define OS_DbgPrint(_t_, _x_) \
57 if (((OskitDebugTraceLevel & OSK_NORMAL_MASK) >= _t_) || \
58 ((OskitDebugTraceLevel & _t_) > OSK_NORMAL_MASK)) { \
59 DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
60 DbgPrint _x_ ; \
61 }
62
63 #endif /* _MSC_VER */
64
65 #if 0
66 #ifdef ASSERT
67 #undef ASSERT
68 #endif
69
70 #ifdef NASSERT
71 #define ASSERT(x)
72 #else /* NASSERT */
73 #define ASSERT(x) if (!(x)) { OS_DbgPrint(MIN_TRACE, ("Assertion "#x" failed at %s:%d\n", __FILE__, __LINE__)); KeBugCheck(0); }
74 #endif /* NASSERT */
75 #endif
76
77 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
78
79 #else /* DBG */
80
81 #define OS_DbgPrint(_t_, _x_)
82
83 #if 0
84 #define ASSERT_IRQL(x)
85 #define ASSERT(x)
86 #endif
87
88 #endif /* DBG */
89
90 #ifndef _MSC_VER
91 #define assert(x) ASSERT(x)
92 #endif//_MSC_VER
93 #define assert_irql(x) ASSERT_IRQL(x)
94
95 #endif /* __OSKITDEBUG_H */
96
97 /* EOF */