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.

116 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. PXDebug.h
  5. Abstract:
  6. Debug macros for Proxy
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. rmachin 11-01-96 created -- after ArvindM's cmadebug.h
  11. Notes:
  12. --*/
  13. #ifndef _PXDebug__H
  14. #define _PXDebug__H
  15. //
  16. // Message verbosity: lower values indicate higher urgency
  17. //
  18. #define PXD_VERY_LOUD 10
  19. #define PXD_LOUD 8
  20. #define PXD_INFO 6
  21. #define PXD_TAPI 5
  22. #define PXD_WARNING 4
  23. #define PXD_ERROR 2
  24. #define PXD_FATAL 1
  25. #define PXM_INIT 0x00000001
  26. #define PXM_CM 0x00000002
  27. #define PXM_CL 0x00000004
  28. #define PXM_CO 0x00000008
  29. #define PXM_UTILS 0x00000010
  30. #define PXM_TAPI 0x00000020
  31. #define PXM_ALL 0xFFFFFFFF
  32. #if DBG
  33. extern ULONG PXDebugLevel; // the value here defines what the user wants to see
  34. // all messages with this urgency and lower are enabled
  35. extern ULONG PXDebugMask;
  36. #define PXDEBUGP(_l, _m, Fmt) \
  37. { \
  38. if ((_l <= PXDebugLevel) && \
  39. (_m & PXDebugMask)) { \
  40. DbgPrint("NDProxy: "); \
  41. DbgPrint Fmt; \
  42. } \
  43. }
  44. #define PxAssert(exp) \
  45. { \
  46. if (!(exp)) { \
  47. DbgPrint("NDPROXY: ASSERTION FAILED! %s\n", #exp); \
  48. DbgPrint("NDPROXY: File: %s, Line: %d\n", __FILE__, __LINE__); \
  49. DbgBreakPoint(); \
  50. } \
  51. }
  52. //
  53. // Memory Allocation/Freeing Auditing:
  54. //
  55. //
  56. //Signature used for all pool allocs
  57. //
  58. #define PXD_MEMORY_SIGNATURE (ULONG)'XPDN'
  59. //
  60. // The PXD_ALLOCATION structure stores all info about one CmaMemAlloc.
  61. //
  62. typedef struct _PXD_ALLOCATION {
  63. LIST_ENTRY Linkage;
  64. ULONG Signature;
  65. ULONG FileNumber;
  66. ULONG LineNumber;
  67. ULONG Size;
  68. ULONG_PTR Location; // where the returned pointer was put
  69. UCHAR UserData;
  70. } PXD_ALLOCATION, *PPXD_ALLOCATION;
  71. PVOID
  72. PxAuditAllocMem (
  73. PVOID pPointer,
  74. ULONG Size,
  75. ULONG Tag,
  76. ULONG FileNumber,
  77. ULONG LineNumber
  78. );
  79. VOID
  80. PxAuditFreeMem(
  81. PVOID Pointer
  82. );
  83. #else // end DBG
  84. //
  85. // No debug
  86. //
  87. #define PXDEBUGP(_l, _m, fmt)
  88. #define PxAssert(exp)
  89. #endif // end !DBG
  90. #endif // _PXDebug__H