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.

74 lines
1.5 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File:
  4. // davedbg.h
  5. //
  6. // Contents:
  7. // A debug trace class
  8. //
  9. // Classes:
  10. // TraceLog
  11. //
  12. // History:
  13. // 04-Sep-94 davepl Created
  14. //
  15. //-----------------------------------------------------------------------------
  16. const ULONG MAX_ARGS = 20;
  17. const ULONG MAX_BUF = 255;
  18. typedef enum tagGROUPSET
  19. {
  20. GS_CACHE = 0x000000001
  21. } GROUPSET;
  22. typedef enum tagDVARTYPE
  23. {
  24. NO_TYPE = 0x0000,
  25. LONG_TYPE = 0x0001,
  26. SHORT_TYPE = 0x0002,
  27. INT_TYPE = 0x0004,
  28. CHAR_TYPE = 0x0008,
  29. STRING_TYPE = 0x0010,
  30. FLOAT_TYPE = 0x0020,
  31. COMMA_TYPE = 0x0040,
  32. MSG_TYPE = 0x0080,
  33. PTR_TYPE = 0x0100,
  34. HEXINT_TYPE = 0x0200
  35. } DVARTYPE;
  36. inline DVARTYPE operator |= (DVARTYPE & vtORON, const DVARTYPE vtORBY)
  37. {
  38. return (vtORON = (DVARTYPE)((int) vtORON | (int) vtORBY));
  39. }
  40. typedef enum tagVERBOSITY
  41. {
  42. VB_SILENT = 0x0000,
  43. VB_MINIMAL = 0x0001,
  44. VB_MODERATE = 0x0002,
  45. VB_MAXIMUM = 0x0004
  46. } VERBOSITY;
  47. class TraceLog
  48. {
  49. public:
  50. TraceLog (void *, char *, GROUPSET, VERBOSITY);
  51. ~TraceLog();
  52. void OnEntry();
  53. void OnEntry(char * pszFormat, ...);
  54. void OnExit (const char * pszFormat, ...);
  55. private:
  56. char m_pszFormat[ MAX_BUF ];
  57. void *m_aPtr[ MAX_ARGS ];
  58. BYTE m_cArgs;
  59. BOOL m_fShouldDisplay;
  60. void *m_pvThat;
  61. char m_pszFunction[MAX_BUF];
  62. };