debug.h

来自「windows 底层驱动」· C头文件 代码 · 共 74 行

H
74
字号
/*+++ *******************************************************************\
*
*   Copyright and Disclaimer:
*
*       ---------------------------------------------------------------
*       This software is provided "as is" without warranty of any kind,
*       either expressed or implied, including but not limited to the
*       implied warranties of merchantability and/or fitness for a
*       particular purpose.
*
*       Copyright (c) 1999-2000 Conexant Systems, Inc.
*       All Rights Reserved.
*       ---------------------------------------------------------------
*     
*   Module Revision Id:
*
*
*   Abstract:
*
*       This file contains declarations for our debug routines.
*
\******************************************************************* ---*/

#ifndef __CAPDEBUG_H
#define __CAPDEBUG_H

extern "C" {

#define DRIVER_POOL_TAG         'Cnxt'

#define DEBUG_PREFIX_ERROR      "cxtuner (error): "
#define DEBUG_PREFIX_WARNING    "cxtuner (warning): "
#define DEBUG_PREFIX_INFO       "cxtuner: "
#define DEBUG_PREFIX_TRACE      "cxtuner: "
#define DEBUG_PREFIX            "cxtuner: "

#ifdef DBG

    // Debug Logging
    // 0 = Errors only
    // 1 = Info, stream state changes, stream open close
    // 2 = Verbose trace

    extern LONG gDebugLevel;
    extern BOOL gBreakOnError;

    #define DbgLog(x)       { if( gDebugLevel >= 0)  {KdPrint((DEBUG_PREFIX));KdPrint(x);} }
    #define DbgLogWarn(x){ if( gDebugLevel >= 0)  {KdPrint((DEBUG_PREFIX));KdPrint(x);} }
    #define DbgLogInfo(x)   { if( gDebugLevel >= 1)  {KdPrint((DEBUG_PREFIX_INFO));KdPrint(x);} }
    #define DbgLogTrace(x)  { if( gDebugLevel >= 2)  {KdPrint((DEBUG_PREFIX_TRACE));KdPrint(x);} }

    #define DbgLogError(x) {                \
        if (gDebugLevel >= 0) {             \
            KdPrint((DEBUG_PREFIX_ERROR));  \
            KdPrint(x);                     \
            if (gBreakOnError) {            \
                KdBreakPoint();             \
            }                               \
        }                                   \
    }

    #define TRAP()   KdBreakPoint();

#else //_DEBUG

    #define TRAP()

#endif //_DEBUG

}

#endif // #ifndef __CAPDEBUG_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?