Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract: Contains debug related definitions.
  6. Environment:
  7. Kernel mode
  8. Author:
  9. Michael Tsang (MikeTs) 13-Mar-2000
  10. Revision History:
  11. --*/
  12. #ifndef _DEBUG_H
  13. #define _DEBUG_H
  14. //
  15. // Constants
  16. //
  17. //
  18. // Macros
  19. //
  20. #ifdef DEBUG
  21. #define TRAP() DbgBreakPoint()
  22. #define DBGPRINT(n,x) if (n <= giVerboseLevel) \
  23. { \
  24. DbgPrint(MODNAME ": %s: ", ProcName); \
  25. DbgPrint x; \
  26. }
  27. #define WARNPRINT(x) { \
  28. DbgPrint(MODNAME "_WARN: %s: ", ProcName);\
  29. DbgPrint x; \
  30. }
  31. #define ERRPRINT(x) { \
  32. DbgPrint(MODNAME "_ERR: %s: ", ProcName);\
  33. DbgPrint x; \
  34. TRAP(); \
  35. }
  36. #else
  37. #define TRAP()
  38. #define DBGPRINT(n,x)
  39. #define WARNPRINT(x)
  40. #define ERRPRINT(x)
  41. #endif //ifdef DEBUG
  42. //
  43. // Type Definitions
  44. //
  45. typedef struct _NAMETABLE
  46. {
  47. ULONG Code;
  48. PSZ pszName;
  49. } NAMETABLE, *PNAMETABLE;
  50. //
  51. // Exported Data Declarations
  52. //
  53. #ifdef DEBUG
  54. extern NAMETABLE MajorFnNames[];
  55. extern NAMETABLE PnPMinorFnNames[];
  56. extern NAMETABLE PowerMinorFnNames[];
  57. extern NAMETABLE PowerStateNames[];
  58. extern NAMETABLE HidIoctlNames[];
  59. extern NAMETABLE QueryIDTypeNames[];
  60. extern FAST_MUTEX gmutexDevExtList; //synchronization for access to list
  61. extern LIST_ENTRY glistDevExtHead; //list of all the device instances
  62. extern int giVerboseLevel;
  63. #endif
  64. //
  65. // Function prototypes
  66. //
  67. #ifdef DEBUG
  68. PSZ INTERNAL
  69. LookupName(
  70. IN ULONG Code,
  71. IN PNAMETABLE NameTable
  72. );
  73. #endif //ifdef DEBUG
  74. #endif //ifndef _DEBUG_H