ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

win32kdebug.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 /*
00004     When a process is created, DbgInitDebugChannels will locate DEBUGCHANNEL
00005     environment variable and extract information about debug channels.
00006     This information includes which of the win32k debug channels will be
00007     enabled for the current process and which level of a channel will be active.
00008     This information will be stored in ppi->DbgChannelLevel.
00009     In this way user mode can control how win32k debugging will work when 
00010     the following macros are used: ERR, FIXME, WARN, TRACE
00011 
00012     By default only the ERR channel will be active. Remember that other
00013     debug channels can be activated for applications that are executed with a DEBUGCHANNEL
00014 
00015     Valid syntax for DEBUGCHANNEL is the following:
00016     +UserProcess,info+UserWnd,err+UserWndpos,-listview
00017     warn+UserMsgQ,-UserMsgGet,+shell
00018 
00019     Note the following:
00020     The debug level is not required
00021     The operation to enable/disable (+/-) and the name of the channel is required
00022     Channels are devided by commas
00023     No spaces are allowed
00024     The syntax is case sensitive. Levels must be lowercase and 
00025     the names of the channels must be exactly like they are defined in DBG_DEFAULT_CHANNEL
00026     This syntax can be mixed with wine debug channels without problems
00027 
00028 */
00029 
00030 #if DBG
00031 
00032     typedef struct
00033     {
00034         PWCHAR Name;
00035         ULONG Id;
00036     } DBG_CHANNEL;
00037 
00038     /* Note: The following values don't need to be sorted */
00039     enum _DEBUGCHANNELS
00040     {
00041         DbgChEngBlt,
00042         DbgChEngBrush,
00043         DbgChEngClip,
00044         DbgChEngCursor,
00045         DbgChEngDev,
00046         DbgChEngErr,
00047         DbgChEngEvent,
00048         DbgChEngGrad,
00049         DbgChEngLDev,
00050         DbgChEngLine,
00051         DbgChEngMapping,
00052         DbgChEngPDev,
00053         DbgChEngSurface,
00054         DbgChEngWnd,
00055         DbgChEngXlate,
00056         DbgChGdiBitmap,
00057         DbgChGdiBlt,
00058         DbgChGdiBrush,
00059         DbgChGdiClipRgn,
00060         DbgChGdiCoord,
00061         DbgChGdiDC,
00062         DbgChGdiDCAttr,
00063         DbgChGdiDCState,
00064         DbgChGdiDev,
00065         DbgChGdiDib,
00066         DbgChGdiFont,
00067         DbgChGdiLine,
00068         DbgChGdiObj,
00069         DbgChGdiPalette,
00070         DbgChGdiPath,
00071         DbgChGdiPen,
00072         DbgChGdiPool,
00073         DbgChGdiRgn,
00074         DbgChGdiText,
00075         DbgChGdiXFormObj,
00076         DbgChUserAccel,
00077         DbgChUserCallback,
00078         DbgChUserCallProc,
00079         DbgChUserCaret,
00080         DbgChUserClass,
00081         DbgChUserClipbrd,
00082         DbgChUserCsr,
00083         DbgChUserDce,
00084         DbgChUserDefwnd,
00085         DbgChUserDesktop,
00086         DbgChUserDisplay,
00087         DbgChUserEvent,
00088         DbgChUserFocus,
00089         DbgChUserHook,
00090         DbgChUserHotkey,
00091         DbgChUserIcon,
00092         DbgChUserInput,
00093         DbgChUserKbd,
00094         DbgChUserKbdLayout,
00095         DbgChUserMenu,
00096         DbgChUserMetric,
00097         DbgChUserMisc,
00098         DbgChUserMonitor,
00099         DbgChUserMsg,
00100         DbgChUserMsgQ,
00101         DbgChUserObj,
00102         DbgChUserPainting,
00103         DbgChUserProcess,
00104         DbgChUserProp,
00105         DbgChUserScrollbar,
00106         DbgChUserSysparams,
00107         DbgChUserThread,
00108         DbgChUserTimer,
00109         DbgChUserWinsta,
00110         DbgChUserWnd,
00111         DbgChUserWinpos,
00112         DbgChCount
00113     };
00114     
00115     #define DISABLED_LEVEL 0x0
00116     #define ERR_LEVEL      0x1
00117     #define FIXME_LEVEL    0x2
00118     #define WARN_LEVEL     0x4
00119     #define TRACE_LEVEL    0x8
00120 
00121     #define MAX_LEVEL ERR_LEVEL | FIXME_LEVEL | WARN_LEVEL | TRACE_LEVEL
00122 
00123     #define DBG_GET_PPI ((PPROCESSINFO)PsGetCurrentProcessWin32Process())
00124     #define DBG_DEFAULT_CHANNEL(x) static int DbgDefaultChannel = DbgCh##x;
00125 
00126     #define DBG_ENABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] |= level)
00127     #define DBG_DISABLE_CHANNEL(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] &= ~level)
00128     #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level) ((ppi)->DbgChannelLevel[ch] & level)
00129 
00130     #define DBG_PRINT(ppi,ch,level,fmt, ...)  do {                            \
00131     if((level == ERR_LEVEL) || (ppi && DBG_IS_CHANNEL_ENABLED(ppi,ch,level))) \
00132         DbgPrint("(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__);          \
00133     }while(0);
00134 
00135     #define ERR(fmt, ...)     DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, ERR_LEVEL,"err: " fmt, ##__VA_ARGS__)
00136     #define FIXME(fmt, ...)   DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, FIXME_LEVEL,"fixme: " fmt, ##__VA_ARGS__)
00137     #define WARN(fmt, ...)    DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, WARN_LEVEL,"warn: " fmt, ##__VA_ARGS__)
00138     #define TRACE(fmt, ...)   DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, TRACE_LEVEL,"trace: " fmt, ##__VA_ARGS__)
00139 
00140     #define ERR_CH(ch,fmt, ...)        DBG_PRINT(DBG_GET_PPI, DbgCh##ch, ERR_LEVEL, "err: " fmt, ##__VA_ARGS__)
00141     #define FIXME_CH(ch,fmt, ...)      DBG_PRINT(DBG_GET_PPI, DbgCh##ch, FIXME_LEVEL, "fixme: " fmt, ##__VA_ARGS__)
00142     #define WARN_CH(ch,fmt, ...)       DBG_PRINT(DBG_GET_PPI, DbgCh##ch, WARN_LEVEL, "warn: " fmt, ##__VA_ARGS__)
00143     #define TRACE_CH(ch,fmt, ...)      DBG_PRINT(DBG_GET_PPI, DbgCh##ch, TRACE_LEVEL, "trace: " fmt, ##__VA_ARGS__)
00144 
00145     #define ERR_PPI(ppi,ch,fmt, ...)   DBG_PRINT(ppi, DbgCh##ch, ERR_LEVEL,"err: " fmt, ##__VA_ARGS__)
00146     #define FIXME_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, FIXME_LEVEL,"fixme: " fmt, ##__VA_ARGS__)
00147     #define WARN_PPI(ppi,ch,fmt, ...)  DBG_PRINT(ppi, DbgCh##ch, WARN_LEVEL,"warn: " fmt, ##__VA_ARGS__)
00148     #define TRACE_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, TRACE_LEVEL,"trace: " fmt, ##__VA_ARGS__)
00149 
00150     #define STUB         DbgPrint("WARNING:  %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
00151 
00152 #else
00153     #define DBG_GET_PPI 
00154     #define DBG_DEFAULT_CHANNEL(x)
00155 
00156     #define DBG_ENABLE_CHANNEL(ppi,ch,level)
00157     #define DBG_DISABLE_CHANNEL(ppi,ch,level)
00158     #define DBG_IS_CHANNEL_ENABLED(ppi,ch,level)
00159 
00160     #define DBG_PRINT(ppi,ch,level) 
00161 
00162     #define ERR(fmt, ...)     
00163     #define FIXME(fmt, ...)   
00164     #define WARN(fmt, ...)    
00165     #define TRACE(fmt, ...)   
00166 
00167     #define ERR_CH(ch,fmt, ...)  
00168     #define FIXME_CH(ch,fmt, ...)
00169     #define WARN_CH(ch,fmt, ...) 
00170     #define TRACE_CH(ch,fmt, ...)
00171 
00172     #define ERR_PPI(ppi,ch,fmt, ...)   
00173     #define FIXME_PPI(ppi,ch,fmt, ...) 
00174     #define WARN_PPI(ppi,ch,fmt, ...)  
00175     #define TRACE_PPI(ppi,ch,fmt, ...) 
00176 
00177     #define STUB
00178 
00179 #endif
00180 
00181 #define KeRosDumpStackFrames(Frames, Count) KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode)
00182 
00183 BOOL DbgInitDebugChannels();

Generated on Sat May 26 2012 04:37:26 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.