Leaked source code of windows server 2003
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.

145 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. dlcdebug.h
  5. Abstract:
  6. Contains debugging prototypes and manifests for ACSLAN
  7. Author:
  8. Richard L Firth (rfirth) 28-May-1992
  9. Revision History:
  10. --*/
  11. #define ARRAY_ELEMENTS(a) (sizeof(a)/sizeof((a)[0]))
  12. #define LAST_ELEMENT(a) (ARRAY_ELEMENTS(a)-1)
  13. #if DBG
  14. #define PRIVATE
  15. #define ACSLAN_DEBUG_ENV_VAR "ACSLAN_DEBUG_FLAGS"
  16. #define ACSLAN_DUMP_FILE_VAR "ACSLAN_DUMP_FILE"
  17. #define ACSLAN_DUMP_FILTER_VAR "ACSLAN_DUMP_FILTER"
  18. #define DEBUG_DUMP_INPUT_CCB 0x00000001L // dump CCB input to AcsLan
  19. #define DEBUG_DUMP_OUTPUT_CCB 0x00000002L // dump CCB output from AcsLan
  20. #define DEBUG_DUMP_TX_INFO 0x00000004L // dump transmit buffers
  21. #define DEBUG_DUMP_RX_INFO 0x00000008L // dump receive buffers
  22. #define DEBUG_DUMP_TX_DATA 0x00000010L // dump data buffer in TRANSMIT commands
  23. #define DEBUG_DUMP_RX_DATA 0x00000020L // dump received data frames
  24. #define DEBUG_DUMP_DATA_CHAIN 0x00000040L // dump entire chain of received data buffers
  25. #define DEBUG_DUMP_FRAME_CHAIN 0x00000080L // dump entire chain of received frames
  26. #define DEBUG_DUMP_TX_ASCII 0x00000100L // dump transmitted data as hex & ASCII
  27. #define DEBUG_DUMP_RX_ASCII 0x00000200L // dump received data as hex & ASCII
  28. #define DEBUG_DUMP_ASYNC_CCBS 0x00000400L // dump READ async. completed CCBs
  29. #define DEBUG_RETURN_CODE 0x01000000L // dump return code from AcsLan/NtAcsLan
  30. #define DEBUG_DUMP_NTACSLAN 0x02000000L // dump CCBs for NtAcsLan, not AcsLan
  31. #define DEBUG_DUMP_ACSLAN 0x04000000L // dump CCBs for AcsLan, not NtAcsLan
  32. #define DEBUG_DUMP_TIME 0x08000000L // dump relative time between commands
  33. #define DEBUG_DLL_INFO 0x10000000L // dump info about DLL attach/detach
  34. #define DEBUG_BREAKPOINT 0x20000000L // break at conditional breakpoints
  35. #define DEBUG_TO_FILE 0x40000000L // dump info to file
  36. #define DEBUG_TO_TERMINAL 0x80000000L // dump info to console
  37. #define IF_DEBUG(c) if (AcslanDebugFlags & DEBUG_##c)
  38. #define PUT(x) AcslanDebugPrint x
  39. #define DUMPCCB DumpCcb
  40. //
  41. // misc.
  42. //
  43. #define DEFAULT_FIELD_WIDTH 16 // amount of description before a number
  44. //
  45. // DumpData options
  46. //
  47. #define DD_DEFAULT_OPTIONS 0x00000000 // use defaults
  48. #define DD_NO_ADDRESS 0x00000001 // don't display address of data
  49. #define DD_LINE_BEFORE 0x00000002 // linefeed before first dumped line
  50. #define DD_LINE_AFTER 0x00000004 // linefeed after last dumped line
  51. #define DD_INDENT_ALL 0x00000008 // indent all lines
  52. #define DD_NO_ASCII 0x00000010 // don't dump ASCII respresentation
  53. #define DD_UPPER_CASE 0x00000020 // upper-case hex dump (F4 instead of f4)
  54. #define DD_DOT_DOT_SPACE 0x00000040 // fill unused hex space with '..'
  55. //
  56. // Filters for individual CCB commands: 4 flags max, because each command is
  57. // represented by a single ASCII character
  58. //
  59. #define CF_DUMP_CCB_IN 0x00000001 // dump CCB on input
  60. #define CF_DUMP_CCB_OUT 0x00000002 // dump CCB on output
  61. #define CF_DUMP_PARMS_IN 0x00000004 // dump parameter table on input
  62. #define CF_DUMP_PARMS_OUT 0x00000008 // dump parameter table on output
  63. //
  64. // global data
  65. //
  66. #ifndef ACSLAN_DEBUG_FLAGS
  67. #define ACSLAN_DEBUG_FLAGS 0
  68. #endif
  69. extern DWORD AcslanDebugFlags;
  70. extern FILE* hDumpFile;
  71. //
  72. // prototypes
  73. //
  74. VOID
  75. GetAcslanDebugFlags(
  76. VOID
  77. );
  78. VOID
  79. SetAcslanDebugFlags(
  80. IN DWORD Flags
  81. );
  82. VOID
  83. AcslanDebugPrint(
  84. IN LPSTR Format,
  85. IN ...
  86. );
  87. VOID
  88. DumpCcb(
  89. IN PLLC_CCB Ccb,
  90. IN BOOL DumpAll,
  91. IN BOOL CcbIsInput
  92. );
  93. VOID
  94. DumpData(
  95. IN LPSTR Title,
  96. IN PBYTE Address,
  97. IN DWORD Length,
  98. IN DWORD Options,
  99. IN DWORD Indent
  100. );
  101. LPSTR
  102. MapCcbRetcode(
  103. IN BYTE Retcode
  104. );
  105. #else
  106. #define PRIVATE static
  107. #define IF_DEBUG(c) if (0)
  108. #define PUT(x)
  109. #define DUMPCCB (void)
  110. #endif