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.

110 lines
3.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. debug.h
  7. This file contains a number of debug-dependent definitions.
  8. FILE HISTORY:
  9. KeithMo 20-Sep-1993 Created.
  10. MohsinA, 20-Nov-96. Robust, added dangling else fix.
  11. */
  12. #ifndef _DEBUG_H_
  13. #define _DEBUG_H_
  14. #ifdef DBG_PRINT
  15. #include <stdarg.h>
  16. #endif // DBG_PRINT
  17. #ifdef DEBUG
  18. #define DBG_MEMALLOC_VERIFY 0x0BEEFCAFE
  19. typedef struct {
  20. LIST_ENTRY Linkage; // to keep linked list of allocated blocks
  21. DWORD Verify; // our signature
  22. DWORD ReqSize; // original size as requested by caller
  23. DWORD Owner[4]; // stack trace 4 deep (of ret.addrs)
  24. } DbgMemBlkHdr;
  25. LIST_ENTRY DbgMemList;
  26. ULONG DbgLeakCheck;
  27. //
  28. // Debug output control flags.
  29. //
  30. #define VXD_DEBUG_INIT 0x00000001L
  31. #define VXD_DEBUG_SOCKET 0x00000002L
  32. #define VXD_DEBUG_MISC 0x00000004L
  33. #define VXD_DEBUG_BIND 0x00000008L
  34. #define VXD_DEBUG_ACCEPT 0x00000010L
  35. #define VXD_DEBUG_CONNECT 0x00000020L
  36. #define VXD_DEBUG_LISTEN 0x00000040L
  37. #define VXD_DEBUG_RECV 0x00000080L
  38. #define VXD_DEBUG_SEND 0x00000100L
  39. #define VXD_DEBUG_SOCKOPT 0x00000200L
  40. #define VXD_DEBUG_CONFIG 0x00000400L
  41. #define VXD_DEBUG_CONNECT_EVENT 0x00000800L
  42. #define VXD_DEBUG_DISCONNECT_EVENT 0x00001000L
  43. #define VXD_DEBUG_ERROR_EVENT 0x00002000L
  44. #define VXD_DEBUG_RECV_EVENT 0x00004000L
  45. #define VXD_DEBUG_RECV_DATAGRAM_EVENT 0x00008000L
  46. #define VXD_DEBUG_RECV_EXPEDITED_EVENT 0x00010000L
  47. // #define VXD_DEBUG_ 0x00020000L
  48. // #define VXD_DEBUG_ 0x00040000L
  49. // #define VXD_DEBUG_ 0x00080000L
  50. // #define VXD_DEBUG_ 0x00100000L
  51. // #define VXD_DEBUG_ 0x00200000L
  52. // #define VXD_DEBUG_ 0x00400000L
  53. // #define VXD_DEBUG_ 0x00800000L
  54. // #define VXD_DEBUG_ 0x01000000L
  55. // #define VXD_DEBUG_ 0x02000000L
  56. // #define VXD_DEBUG_ 0x04000000L
  57. // #define VXD_DEBUG_ 0x08000000L
  58. // #define VXD_DEBUG_ 0x10000000L
  59. // #define VXD_DEBUG_ 0x20000000L
  60. // #define VXD_DEBUG_ 0x40000000L
  61. #define VXD_DEBUG_OUTPUT_TO_DEBUGGER 0x80000000L
  62. //
  63. // Assert & require.
  64. //
  65. void VxdAssert( void * pAssertion,
  66. void * pFileName,
  67. unsigned long nLineNumber );
  68. #define VXD_ASSERT(exp) \
  69. if( !(exp) ){ VxdAssert( #exp, __FILE__, __LINE__ ); }else{}
  70. #define VXD_REQUIRE VXD_ASSERT
  71. #define DEBUG_BREAK _asm int 3
  72. #else // !DEBUG =========================================================
  73. //
  74. // Null assert & require.
  75. //
  76. #define VXD_ASSERT(exp) /* Nothing */
  77. #define VXD_REQUIRE(exp) ((void)(exp))
  78. #define DEBUG_BREAK /* Nothing */
  79. #endif // DEBUG
  80. #endif // _DEBUG_H_