00001
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _DEBUG_H
00033 #define _DEBUG_H
00034
00035
00036
00037
00038
00039 #if !defined(_DEBUG) && defined(DBG)
00040 #define _DEBUG DBG
00041 #elif defined(_DEBUG) && !defined(DBG)
00042 #define DBG _DEBUG
00043 #endif
00044
00045 #ifdef KERNEL_MODE
00046 #define DLLTEXT(s) __TEXT("CCPSRendering: ") __TEXT(s)
00047 #else
00048 #define DLLTEXT(s) __TEXT("CCPrintUI: ") __TEXT(s)
00049 #endif
00050 #define ERRORTEXT(s) __TEXT("ERROR ") DLLTEXT(s)
00051
00052
00054
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 #define DBG_VERBOSE 1
00097 #define DBG_TERSE 2
00098 #define DBG_WARNING 3
00099 #define DBG_ERROR 4
00100 #define DBG_RIP 5
00101 #define DBG_NONE 6
00102
00103 #if DBG
00104
00105 #define DebugMsg DebugMessage
00106
00107
00108
00109
00110
00111 PCSTR
00112 StripDirPrefixA(
00113 IN PCSTR pstrFilename
00114 );
00115
00116 extern INT giDebugLevel;
00117
00118
00119 #define DBGMSG(level, prefix, msg) { \
00120 if (giDebugLevel <= (level)) { \
00121 DebugMsg("%s %s (%d): ", prefix, StripDirPrefixA(__FILE__), __LINE__); \
00122 DebugMsg(msg); \
00123 } \
00124 }
00125
00126 #define DBGPRINT(level, msg) { \
00127 if (giDebugLevel <= (level)) { \
00128 DebugMsg(msg); \
00129 } \
00130 }
00131
00132 #define VERBOSE if(giDebugLevel <= DBG_VERBOSE) DebugMsg
00133 #define TERSE if(giDebugLevel <= DBG_TERSE) DebugMsg
00134 #define WARNING if(giDebugLevel <= DBG_WARNING) DebugMsg
00135 #define ERR if(giDebugLevel <= DBG_ERROR) DebugMsg
00136
00137 #define ASSERT(cond) { \
00138 if (! (cond)) { \
00139 RIP(("\n")); \
00140 } \
00141 }
00142
00143 #define ASSERTMSG(cond, msg) { \
00144 if (! (cond)) { \
00145 RIP(msg); \
00146 } \
00147 }
00148
00149 #define RIP(msg) { \
00150 DBGMSG(DBG_RIP, "RIP", msg); \
00151 DebugBreak(); \
00152 }
00153
00154
00155 #else // !DBG
00156
00157 #define DebugMsg NOP_FUNCTION
00158
00159 #define VERBOSE NOP_FUNCTION
00160 #define TERSE NOP_FUNCTION
00161 #define WARNING NOP_FUNCTION
00162 #define ERR NOP_FUNCTION
00163
00164 #define ASSERT(cond)
00165
00166 #define ASSERTMSG(cond, msg)
00167 #define RIP(msg)
00168 #define DBGMSG(level, prefix, msg)
00169 #define DBGPRINT(level, msg)
00170
00171 #endif
00172
00173
00174
00175
00177
00179
00180 BOOL DebugMessage(LPCSTR, ...);
00181 BOOL DebugMessage(LPCWSTR, ...);
00182 void Dump(PPUBLISHERINFO pPublisherInfo);
00183 void Dump(POEMDMPARAM pOemDMParam);
00184 #ifndef KERNEL_MODE
00185 void Dump(PPROPSHEETUI_INFO pPSUIInfo);
00186 #endif
00187
00188 #endif
00189
00190
00191