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.

100 lines
2.4 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 NAMETABLE SerialIoctlNames[];
  61. extern NAMETABLE SerialInternalIoctlNames[];
  62. extern FAST_MUTEX gmutexDevExtList; //synchronization for access to list
  63. extern LIST_ENTRY glistDevExtHead; //list of all the device instances
  64. extern int giVerboseLevel;
  65. extern USHORT gwMaxX;
  66. extern USHORT gwMaxY;
  67. extern USHORT gwMaxDX;
  68. extern USHORT gwMaxDY;
  69. extern ULONG gdwcSamples;
  70. extern ULONG gdwcLostBytes;
  71. extern LARGE_INTEGER gStartTime;
  72. #endif
  73. //
  74. // Function prototypes
  75. //
  76. #ifdef DEBUG
  77. PSZ INTERNAL
  78. LookupName(
  79. IN ULONG Code,
  80. IN PNAMETABLE NameTable
  81. );
  82. #endif //ifdef DEBUG
  83. #endif //ifndef _DEBUG_H