Windows NT 4.0 source code leak
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.

150 lines
3.6 KiB

4 years ago
  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. */
  11. #ifndef _DEBUG_H_
  12. #define _DEBUG_H_
  13. #ifdef DEBUG
  14. #include <stdarg.h>
  15. #define DBG_MEMALLOC_VERIFY 0x0BEEFCAFE
  16. typedef struct {
  17. LIST_ENTRY Linkage; // to keep linked list of allocated blocks
  18. DWORD Verify; // our signature
  19. DWORD ReqSize; // original size as requested by caller
  20. DWORD Owner[4]; // stack trace 4 deep (of ret.addrs)
  21. } DbgMemBlkHdr;
  22. LIST_ENTRY DbgMemList;
  23. ULONG DbgLeakCheck;
  24. //
  25. // Debug output control flags.
  26. //
  27. extern DWORD VxdDebugFlags;
  28. #define VXD_DEBUG_INIT 0x00000001L
  29. #define VXD_DEBUG_SOCKET 0x00000002L
  30. #define VXD_DEBUG_MISC 0x00000004L
  31. #define VXD_DEBUG_BIND 0x00000008L
  32. #define VXD_DEBUG_ACCEPT 0x00000010L
  33. #define VXD_DEBUG_CONNECT 0x00000020L
  34. #define VXD_DEBUG_LISTEN 0x00000040L
  35. #define VXD_DEBUG_RECV 0x00000080L
  36. #define VXD_DEBUG_SEND 0x00000100L
  37. #define VXD_DEBUG_SOCKOPT 0x00000200L
  38. #define VXD_DEBUG_CONFIG 0x00000400L
  39. #define VXD_DEBUG_CONNECT_EVENT 0x00000800L
  40. #define VXD_DEBUG_DISCONNECT_EVENT 0x00001000L
  41. #define VXD_DEBUG_ERROR_EVENT 0x00002000L
  42. #define VXD_DEBUG_RECV_EVENT 0x00004000L
  43. #define VXD_DEBUG_RECV_DATAGRAM_EVENT 0x00008000L
  44. #define VXD_DEBUG_RECV_EXPEDITED_EVENT 0x00010000L
  45. // #define VXD_DEBUG_ 0x00020000L
  46. // #define VXD_DEBUG_ 0x00040000L
  47. // #define VXD_DEBUG_ 0x00080000L
  48. // #define VXD_DEBUG_ 0x00100000L
  49. // #define VXD_DEBUG_ 0x00200000L
  50. // #define VXD_DEBUG_ 0x00400000L
  51. // #define VXD_DEBUG_ 0x00800000L
  52. // #define VXD_DEBUG_ 0x01000000L
  53. // #define VXD_DEBUG_ 0x02000000L
  54. // #define VXD_DEBUG_ 0x04000000L
  55. // #define VXD_DEBUG_ 0x08000000L
  56. // #define VXD_DEBUG_ 0x10000000L
  57. // #define VXD_DEBUG_ 0x20000000L
  58. // #define VXD_DEBUG_ 0x40000000L
  59. #define VXD_DEBUG_OUTPUT_TO_DEBUGGER 0x80000000L
  60. //
  61. // Debug output function.
  62. //
  63. void VxdPrintf( char * pszFormat,
  64. ... );
  65. int VxdSprintf( char * pszStr,
  66. char * pszFmt,
  67. ... );
  68. #define VXD_PRINT(args) VxdPrintf args
  69. //
  70. // Assert & require.
  71. //
  72. void VxdAssert( void * pAssertion,
  73. void * pFileName,
  74. unsigned long nLineNumber );
  75. #define VXD_ASSERT(exp) if (!(exp)) VxdAssert( #exp, __FILE__, __LINE__ )
  76. #define VXD_REQUIRE VXD_ASSERT
  77. //
  78. // Miscellaneous goodies.
  79. //
  80. void VxdDebugOutput( char * pszMessage );
  81. #define DEBUG_BREAK _asm int 3
  82. #define DEBUG_OUTPUT(x) VxdDebugOutput(x)
  83. #else // !DEBUG
  84. //
  85. // No debug output.
  86. //
  87. #define IF_DEBUG(flag) if (0)
  88. //
  89. // Null debug output function.
  90. //
  91. #define VXD_PRINT(args)
  92. //
  93. // Null assert & require.
  94. //
  95. #define VXD_ASSERT(exp)
  96. #define VXD_REQUIRE(exp) ((void)(exp))
  97. //
  98. // No goodies.
  99. //
  100. #define DEBUG_BREAK
  101. #define DEBUG_OUTPUT(x)
  102. #endif // DEBUG
  103. #endif // _DEBUG_H_