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.

176 lines
4.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////\
  2. //
  3. // Copyright (c) 1990 Microsoft Corporation
  4. //
  5. // Module Name:
  6. //
  7. // test.h
  8. //
  9. // Abstract:
  10. //
  11. // The main header for the NDIS/KS test driver
  12. //
  13. // Author:
  14. //
  15. // P Porzuczek
  16. //
  17. // Environment:
  18. //
  19. // Notes:
  20. //
  21. // Revision History:
  22. //
  23. //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. #ifndef _MAIN_H
  26. #define _MAIN_H
  27. #ifdef DBG
  28. extern ULONG TestDebugFlag;
  29. #define TEST_DBG_NONE 0x00000000
  30. #define TEST_DBG_TRACE 0x00000001
  31. #define TEST_DBG_WRITE_DATA 0x00000002
  32. #define TEST_DBG_READ_DATA 0x00000004
  33. #define TEST_DBG_RECV 0x00000008
  34. #define TEST_DBG_SRB 0x00000010
  35. #define TEST_DBG_CRC 0x00000020
  36. #define TEST_DBG_MPE 0x00000040
  37. #define TEST_DBG_DETAIL 0x00001000
  38. #define TEST_DBG_INFO 0x00002000
  39. #define TEST_DBG_WARNING 0x00004000
  40. #define TEST_DBG_ERROR 0x00008000
  41. #ifdef DEBUG_EXTRAS
  42. #define TEST_DEBUG(_Trace, _Msg) \
  43. { \
  44. __int64 llTime = 0; \
  45. ULONG ulTime = 0; \
  46. NdisGetCurrentSystemTime ((PLARGE_INTEGER)&llTime); \
  47. ulTime = (ULONG) (llTime >> 2); \
  48. if (_Trace & TestDebugFlag) \
  49. { \
  50. DbgPrint ("%04X %08X %-10.10s %4d ", ulTime & 0xffff, _Trace, &__FILE__[2], __LINE__); \
  51. DbgPrint _Msg; \
  52. } \
  53. }
  54. #else
  55. #define TEST_DEBUG(_Trace, _Msg) \
  56. { \
  57. if (_Trace & TestDebugFlag) \
  58. { \
  59. DbgPrint _Msg; \
  60. } \
  61. }
  62. #endif // DEBUG_EXTRAS
  63. #define IF_TESTDEBUG(f) if (TestDebugFlag & (f))
  64. #define TEST_DEBUG_LOUD 0x00010000 // debugging info
  65. #define TEST_DEBUG_VERY_LOUD 0x00020000 // excessive debugging info
  66. #define TEST_DEBUG_LOG 0x00040000 // enable Log
  67. #define TEST_DEBUG_CHECK_DUP_SENDS 0x00080000 // check for duplicate sends
  68. #define TEST_DEBUG_TRACK_PACKET_LENS 0x00100000 // track directed packet lens
  69. #define TEST_DEBUG_WORKAROUND1 0x00200000 // drop DFR/DIS packets
  70. #define TEST_DEBUG_CARD_BAD 0x00400000 // dump data if CARD_BAD
  71. #define TEST_DEBUG_CARD_TESTS 0x00800000 // print reason for failing
  72. //
  73. // Macro for deciding whether to print a lot of debugging information.
  74. //
  75. #define IF_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_LOUD ) { A }
  76. #define IF_VERY_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_VERY_LOUD ) { A }
  77. //
  78. // Whether to use the Log buffer to record a trace of the driver.
  79. //
  80. #define IF_LOG(A) IF_TESTDEBUG( TEST_DEBUG_LOG ) { A }
  81. extern VOID TESTLog(UCHAR);
  82. //
  83. // Whether to do loud init failure
  84. //
  85. #define IF_INIT(A) A
  86. //
  87. // Whether to do loud card test failures
  88. //
  89. #define IF_TEST(A) IF_TESTDEBUG( TEST_DEBUG_CARD_TESTS ) { A }
  90. #else
  91. extern ULONG TestDebugFlag;
  92. #define TEST_NONE
  93. #define TEST_FUNCTIONS
  94. #define TEST_COMMANDS
  95. #define TEST_CONNECTIONS
  96. #define TEST_SCIDS
  97. #define TEST_LIST_ALLOCS
  98. #define TEST_POOL
  99. #define TEST_INDICATES
  100. #define TEST_ALLOCATION
  101. #define TEST_DEBUG(_Trace, _Msg)
  102. #define IF_TESTDEBUG(f)
  103. #define TEST_DEBUG_LOUD
  104. #define TEST_DEBUG_VERY_LOUD
  105. #define TEST_DEBUG_LOG
  106. #define TEST_DEBUG_CHECK_DUP_SENDS
  107. #define TEST_DEBUG_TRACK_PACKET_LENS
  108. #define TEST_DEBUG_WORKAROUND1
  109. #define TEST_DEBUG_CARD_BAD
  110. #define TEST_DEBUG_CARD_TESTS
  111. //
  112. // This is not a debug build, so make everything quiet.
  113. //
  114. #define IF_LOUD(A)
  115. #define IF_VERY_LOUD(A)
  116. #define IF_LOG(A)
  117. #define IF_INIT(A)
  118. #define IF_TEST(A)
  119. #endif // DBG
  120. NTSTATUS
  121. DriverEntry (
  122. IN PDRIVER_OBJECT pDriverObject,
  123. IN PUNICODE_STRING pszuRegistryPath);
  124. VOID
  125. MpeFreeMemory (
  126. PVOID pvToFree,
  127. ULONG ulSize
  128. );
  129. NTSTATUS
  130. MpeAllocateMemory (
  131. PVOID *ppvAllocated,
  132. ULONG ulcbSize
  133. );
  134. NTSTATUS
  135. MpeDriverInitialize (
  136. IN PDRIVER_OBJECT DriverObject,
  137. IN PUNICODE_STRING RegistryPath
  138. );
  139. #endif // _MAIN_H
  140.