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.

85 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. trdebug.h
  5. Abstract: Contains debug related definitions.
  6. Environment:
  7. User mode
  8. Author:
  9. Michael Tsang (MikeTs) 13-Mar-2000
  10. Revision History:
  11. --*/
  12. #ifndef _TRDEBUG_H
  13. #define _TRDEBUG_H
  14. //
  15. // Macros
  16. //
  17. #ifdef TRDEBUG
  18. #define TRASSERT(x) if (!(x)) \
  19. { \
  20. TRDebugPrint("Assertion failed in file " \
  21. "%s at line %d\n", \
  22. __FILE__, __LINE__); \
  23. }
  24. #define TRDBGPRINT(n,x) if ((n) <= giTRVerboseLevel) \
  25. { \
  26. TRDebugPrint(MODNAME ": %s: ", ProcName); \
  27. TRDebugPrint x; \
  28. }
  29. #define TRWARNPRINT(x) { \
  30. TRDebugPrint(MODNAME "_WARN: %s: ", \
  31. ProcName); \
  32. TRDebugPrint x; \
  33. }
  34. #define TRERRPRINT(x) { \
  35. TRDebugPrint(MODNAME "_ERR: %s: ", \
  36. ProcName); \
  37. TRDebugPrint x; \
  38. DebugBreak(); \
  39. }
  40. #else
  41. #define TRASSERT(x)
  42. #define TRDBGPRINT(n,x)
  43. #define TRWARNPRINT(x)
  44. #define TRERRPRINT(x)
  45. #endif //ifdef TRDEBUG
  46. //
  47. // Exported Data Declarations
  48. //
  49. #ifdef TRDEBUG
  50. extern int giTRVerboseLevel;
  51. extern NAMETABLE WMMsgNames[];
  52. extern NAMETABLE WinTraceMsgNames[];
  53. #endif
  54. //
  55. // Exported function prototypes
  56. //
  57. #ifdef TRDEBUG
  58. int
  59. TRDebugPrint(
  60. IN LPCSTR format,
  61. ...
  62. );
  63. PSZ
  64. LookupName(
  65. IN ULONG Code,
  66. IN PNAMETABLE NameTable
  67. );
  68. #endif //ifdef TRDEBUG
  69. #endif //ifndef _TRDEBUG_H