Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenksdebug.h
Go to the documentation of this file.
00001 /* 00002 * ksdebug.h 00003 * 00004 * This file is part of the ReactOS PSDK package. 00005 * 00006 * Contributors: 00007 * Created by Magnus Olsen. 00008 * 00009 * THIS SOFTWARE IS NOT COPYRIGHTED 00010 * 00011 * This source code is offered for use in the public domain. You may 00012 * use, modify or distribute it freely. 00013 * 00014 * This code is distributed in the hope that it will be useful but 00015 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 00016 * DISCLAIMED. This includes but is not limited to warranties of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 * 00019 */ 00020 00021 #include <evntrace.h> 00022 00023 #if !defined(_KSDEBUG_) 00024 #define _KSDEBUG_ 00025 00026 #if !defined(REMIND) 00027 #define QUOTE(x) #x 00028 #define QQUOTE(y) QUOTE(y) 00029 #define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) ") : " str 00030 #endif 00031 00032 #if defined(__cplusplus) 00033 extern "C" { 00034 #endif 00035 00036 #if (DBG) 00037 00038 #if defined(IRPMJFUNCDESC) 00039 static const PCHAR IrpMjFuncDesc[] = { 00040 "IRP_MJ_CREATE", 00041 "IRP_MJ_CREATE_NAMED_PIPE", 00042 "IRP_MJ_CLOSE", 00043 "IRP_MJ_READ", 00044 "IRP_MJ_WRITE", 00045 "IRP_MJ_QUERY_INFORMATION", 00046 "IRP_MJ_SET_INFORMATION", 00047 "IRP_MJ_QUERY_EA", 00048 "IRP_MJ_SET_EA", 00049 "IRP_MJ_FLUSH_BUFFERS", 00050 "IRP_MJ_QUERY_VOLUME_INFORMATION", 00051 "IRP_MJ_SET_VOLUME_INFORMATION", 00052 "IRP_MJ_DIRECTORY_CONTROL", 00053 "IRP_MJ_FILE_SYSTEM_CONTROL", 00054 "IRP_MJ_DEVICE_CONTROL", 00055 "IRP_MJ_INTERNAL_DEVICE_CONTROL", 00056 "IRP_MJ_SHUTDOWN", 00057 "IRP_MJ_LOCK_CONTROL", 00058 "IRP_MJ_CLEANUP", 00059 "IRP_MJ_CREATE_MAILSLOT", 00060 "IRP_MJ_QUERY_SECURITY", 00061 "IRP_MJ_SET_SECURITY", 00062 "IRP_MJ_SET_POWER", 00063 "IRP_MJ_QUERY_POWER" 00064 }; 00065 #endif /* defined(IRPMJFUNCDESC) */ 00066 00067 #endif /* DBG */ 00068 00069 #if defined(_NTDDK_) 00070 00071 #define DEBUGLVL_BLAB TRACE_LEVEL_VERBOSE 00072 #define DEBUGLVL_VERBOSE TRACE_LEVEL_VERBOSE 00073 #define DEBUGLVL_TERSE TRACE_LEVEL_INFORMATION 00074 #define DEBUGLVL_ERROR TRACE_LEVEL_ERROR 00075 00076 #define DEBUGLVL_WARNING TRACE_LEVEL_WARNING 00077 #define DEBUGLVL_INFO TRACE_LEVEL_INFORMATION 00078 00079 #if (DBG) 00080 #if !defined( DEBUG_LEVEL ) 00081 #if defined( DEBUG_VARIABLE ) 00082 #if defined( KSDEBUG_INIT ) 00083 ULONG DEBUG_VARIABLE = DEBUGLVL_TERSE; 00084 #else 00085 extern ULONG DEBUG_VARIABLE; 00086 #endif 00087 #else 00088 #define DEBUG_VARIABLE DEBUGLVL_TERSE 00089 #endif 00090 #else 00091 #if defined( DEBUG_VARIABLE ) 00092 #if defined( KSDEBUG_INIT ) 00093 ULONG DEBUG_VARIABLE = DEBUG_LEVEL; 00094 #else 00095 extern ULONG DEBUG_VARIABLE; 00096 #endif 00097 #else 00098 #define DEBUG_VARIABLE DEBUG_LEVEL 00099 #endif 00100 #endif 00101 00102 #if (NTDDI_VERSION >= NTDDI_WINXP) 00103 #define _DbgPrintFEx(component, lvl, strings) { \ 00104 if ((lvl) <= DEBUG_VARIABLE) { \ 00105 DbgPrintEx(component, lvl, STR_MODULENAME); \ 00106 DbgPrintEx(component, lvl, strings); \ 00107 DbgPrintEx(component, lvl, "\n"); \ 00108 if ((lvl) == DEBUGLVL_ERROR) { \ 00109 DbgBreakPoint(); \ 00110 } \ 00111 } \ 00112 } 00113 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ 00114 00115 #define _DbgPrintF(lvl, strings) { \ 00116 if (((lvl)==DEBUG_VARIABLE) || (lvl < DEBUG_VARIABLE)) { \ 00117 DbgPrint(STR_MODULENAME); \ 00118 DbgPrint##strings; \ 00119 DbgPrint("\n"); \ 00120 if ((lvl) == DEBUGLVL_ERROR) { \ 00121 DbgBreakPoint(); \ 00122 } \ 00123 } \ 00124 } 00125 00126 #else 00127 00128 #define _DbgPrintF(lvl, strings) 00129 00130 #if (NTDDI_VERSION >= NTDDI_WINXP) 00131 #define _DbgPrintFEx(component, lvl, strings) 00132 #endif 00133 00134 #endif /* DBG */ 00135 00136 #endif /* defined(_NTDDK_) */ 00137 00138 #if defined(__cplusplus) 00139 } 00140 #endif 00141 00142 #endif /* _KSDEBUG_ */ Generated on Sat May 26 2012 04:30:19 for ReactOS by
1.7.6.1
|