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.

94 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1998 - 1999 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract: Contains definitions and macros to aid debugging
  6. data types for the joystick driver.
  7. Environment:
  8. Kernel mode
  9. @@BEGIN_DDKSPLIT
  10. Author:
  11. MarcAnd 15-Oct-98 Pulled out of hidgame.h
  12. Revision History:
  13. @@END_DDKSPLIT
  14. --*/
  15. /*
  16. * Debugging macros
  17. */
  18. #undef C_ASSERT
  19. #define C_ASSERT(e) switch(0) case(e): case(0):
  20. #define FILE_HIDGAME 0x00010000
  21. #define FILE_PNP 0x00020000
  22. #define FILE_POLL 0x00040000
  23. #define FILE_IOCTL 0x00080000
  24. #define FILE_HIDJOY 0x00100000
  25. #define FILE_TIMING 0x00200000
  26. #define HGM_ERROR 0x00000001
  27. #define HGM_WARN 0x00000002
  28. #define HGM_BABBLE 0x00000004
  29. #define HGM_BABBLE2 0x00000008
  30. #define HGM_FENTRY 0x00000010
  31. #define HGM_FEXIT 0x00000020
  32. #define HGM_GEN_REPORT 0x00008000
  33. /*
  34. * Squak if the return status is not SUCCEESS
  35. */
  36. #define HGM_FEXIT_STATUSOK 0x00001000
  37. #define HGM_DEFAULT_DEBUGLEVEL 0x0000001
  38. /* @@BEGIN_DDKSPLIT */
  39. /* Use set USER_C_FLAGS=/DDEBUGLEVEL=0x0000803f for full internal debug */
  40. #ifdef DEBUGLEVEL
  41. #undef HGM_DEFAULT_DEBUGLEVEL
  42. #define HGM_DEFAULT_DEBUGLEVEL DEBUGLEVEL
  43. #endif
  44. /* @@END_DDKSPLIT */
  45. #define HGM_POOL_TAG ('maGH')
  46. /* WDM.H defines DBG. Make sure DBG is both defined and non-zero */
  47. #ifdef DBG
  48. #if DBG
  49. #define TRAP() DbgBreakPoint()
  50. #endif
  51. #endif
  52. #ifdef TRAP
  53. extern ULONG debugLevel;
  54. #define HGM_DBGPRINT( _debugMask_, _x_) \
  55. if( (((_debugMask_) & debugLevel)) ){ \
  56. DbgPrint("HIDGAME.SYS: ");\
  57. DbgPrint _x_ ; \
  58. DbgPrint("\n"); \
  59. }
  60. #define HGM_EXITPROC(_debugMask_, _x_, ntStatus) \
  61. if( ((_debugMask_)&HGM_FEXIT_STATUSOK) && !NT_SUCCESS(ntStatus) ) {\
  62. HGM_DBGPRINT( (_debugMask_|HGM_ERROR), (_x_ " ntStatus(0x%x)", ntStatus) ); }\
  63. else { HGM_DBGPRINT((_debugMask_), (_x_ " ntStatus(0x%x)", ntStatus));}
  64. #define ExAllocPool( Type, Size ) \
  65. ExAllocatePoolWithTag( Type, Size, HIDGAME_POOL_TAG )
  66. #else
  67. #define HGM_DBGPRINT(_x_,_y_)
  68. #define HGM_EXITPROC(_x_,_y_,_z_)
  69. #define TRAP()
  70. #define ExAllocPool( Type, Size ) ExAllocatePool( Type, Size )
  71. #endif