32 #if !defined(__RELFILE__)
33 #define __RELFILE__ __FILE__
109 DbgChUserPowerManager,
123 #define DISABLED_LEVEL 0x0
124 #define ERR_LEVEL 0x1
125 #define FIXME_LEVEL 0x2
126 #define WARN_LEVEL 0x4
127 #define TRACE_LEVEL 0x8
129 #define MAX_LEVEL ERR_LEVEL | FIXME_LEVEL | WARN_LEVEL | TRACE_LEVEL
131 #define DBG_GET_PPI ((PPROCESSINFO)PsGetCurrentProcessWin32Process())
132 #define DBG_DEFAULT_CHANNEL(x) static int DbgDefaultChannel = DbgCh##x;
134 #define DBG_ENABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] |= level)
135 #define DBG_DISABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] &= ~level)
136 #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level) (((ppi)->DbgChannelLevel[ch] & level) == level)
138 #define DBG_PRINT(ppi,ch,level,fmt, ...) \
140 if ((level == ERR_LEVEL) || (ppi && DBG_IS_CHANNEL_ENABLED(ppi,ch,level))) \
141 DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__); \
144 #define ERR(fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, ERR_LEVEL,"err: " fmt, ##__VA_ARGS__)
145 #define FIXME(fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, FIXME_LEVEL,"fixme: " fmt, ##__VA_ARGS__)
146 #define WARN(fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, WARN_LEVEL,"warn: " fmt, ##__VA_ARGS__)
147 #define TRACE(fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, TRACE_LEVEL,"trace: " fmt, ##__VA_ARGS__)
149 #define ERR_CH(ch,fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgCh##ch, ERR_LEVEL, "err: " fmt, ##__VA_ARGS__)
150 #define FIXME_CH(ch,fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgCh##ch, FIXME_LEVEL, "fixme: " fmt, ##__VA_ARGS__)
151 #define WARN_CH(ch,fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgCh##ch, WARN_LEVEL, "warn: " fmt, ##__VA_ARGS__)
152 #define TRACE_CH(ch,fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgCh##ch, TRACE_LEVEL, "trace: " fmt, ##__VA_ARGS__)
154 #define ERR_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, ERR_LEVEL,"err: " fmt, ##__VA_ARGS__)
155 #define FIXME_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, FIXME_LEVEL,"fixme: " fmt, ##__VA_ARGS__)
156 #define WARN_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, WARN_LEVEL,"warn: " fmt, ##__VA_ARGS__)
157 #define TRACE_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, TRACE_LEVEL,"trace: " fmt, ##__VA_ARGS__)
159 #define STUB DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__RELFILE__,__LINE__);
163 #define DBG_DEFAULT_CHANNEL(x)
165 #define DBG_ENABLE_CHANNEL(ppi,ch,level)
166 #define DBG_DISABLE_CHANNEL(ppi,ch,level)
167 #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level)
169 #define DBG_PRINT(ppi,ch,level)
171 #define ERR(fmt, ...)
172 #define FIXME(fmt, ...)
173 #define WARN(fmt, ...)
174 #define TRACE(fmt, ...)
176 #define ERR_CH(ch,fmt, ...)
177 #define FIXME_CH(ch,fmt, ...)
178 #define WARN_CH(ch,fmt, ...)
179 #define TRACE_CH(ch,fmt, ...)
181 #define ERR_PPI(ppi,ch,fmt, ...)
182 #define FIXME_PPI(ppi,ch,fmt, ...)
183 #define WARN_PPI(ppi,ch,fmt, ...)
184 #define TRACE_PPI(ppi,ch,fmt, ...)
BOOL DbgInitDebugChannels()