Leaked source code of windows server 2003
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.

88 lines
2.4 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. /* WDM.H defines DBG. Make sure DBG is both defined and non-zero */
  46. #ifdef DBG
  47. #if DBG
  48. #define TRAP() DbgBreakPoint()
  49. #endif
  50. #endif
  51. #ifdef TRAP
  52. extern ULONG debugLevel;
  53. #define HGM_DBGPRINT( _debugMask_, _x_) \
  54. if( (((_debugMask_) & debugLevel)) ){ \
  55. DbgPrint("HIDGAME.SYS: ");\
  56. DbgPrint _x_ ; \
  57. DbgPrint("\n"); \
  58. }
  59. #define HGM_EXITPROC(_debugMask_, _x_, ntStatus) \
  60. if( ((_debugMask_)&HGM_FEXIT_STATUSOK) && !NT_SUCCESS(ntStatus) ) {\
  61. HGM_DBGPRINT( (_debugMask_|HGM_ERROR), (_x_ " ntStatus(0x%x)", ntStatus) ); }\
  62. else { HGM_DBGPRINT((_debugMask_), (_x_ " ntStatus(0x%x)", ntStatus));}
  63. #else
  64. #define HGM_DBGPRINT(_x_,_y_)
  65. #define HGM_EXITPROC(_x_,_y_,_z_)
  66. #define TRAP()
  67. #endif