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.

153 lines
3.3 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_GET 0x00000002
  32. #define TEST_DBG_BUF 0x00000080
  33. #define TEST_DBG_DETAIL 0x00001000
  34. #define TEST_DBG_INFO 0x00002000
  35. #define TEST_DBG_WARNING 0x00004000
  36. #define TEST_DBG_ERROR 0x00008000
  37. #define TEST_DEBUG(_Trace, _Msg) \
  38. { \
  39. if (_Trace & TestDebugFlag) \
  40. { \
  41. DbgPrint _Msg; \
  42. } \
  43. }
  44. #define IF_TESTDEBUG(f) if (TestDebugFlag & (f))
  45. #define TEST_DEBUG_LOUD 0x00010000 // debugging info
  46. #define TEST_DEBUG_VERY_LOUD 0x00020000 // excessive debugging info
  47. #define TEST_DEBUG_LOG 0x00040000 // enable Log
  48. #define TEST_DEBUG_CHECK_DUP_SENDS 0x00080000 // check for duplicate sends
  49. #define TEST_DEBUG_TRACK_PACKET_LENS 0x00100000 // track directed packet lens
  50. #define TEST_DEBUG_WORKAROUND1 0x00200000 // drop DFR/DIS packets
  51. #define TEST_DEBUG_CARD_BAD 0x00400000 // dump data if CARD_BAD
  52. #define TEST_DEBUG_CARD_TESTS 0x00800000 // print reason for failing
  53. //
  54. // Macro for deciding whether to print a lot of debugging information.
  55. //
  56. #define IF_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_LOUD ) { A }
  57. #define IF_VERY_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_VERY_LOUD ) { A }
  58. //
  59. // Whether to use the Log buffer to record a trace of the driver.
  60. //
  61. #define IF_LOG(A) IF_TESTDEBUG( TEST_DEBUG_LOG ) { A }
  62. extern VOID TESTLog(UCHAR);
  63. //
  64. // Whether to do loud init failure
  65. //
  66. #define IF_INIT(A) A
  67. //
  68. // Whether to do loud card test failures
  69. //
  70. #define IF_TEST(A) IF_TESTDEBUG( TEST_DEBUG_CARD_TESTS ) { A }
  71. #else
  72. //extern ULONG TestDebugFlag;
  73. #define TEST_NONE
  74. #define TEST_FUNCTIONS
  75. #define TEST_COMMANDS
  76. #define TEST_CONNECTIONS
  77. #define TEST_SCIDS
  78. #define TEST_LIST_ALLOCS
  79. #define TEST_POOL
  80. #define TEST_INDICATES
  81. #define TEST_ALLOCATION
  82. #define TEST_DEBUG(_Trace, _Msg)
  83. #define IF_TESTDEBUG(f)
  84. #define TEST_DEBUG_LOUD
  85. #define TEST_DEBUG_VERY_LOUD
  86. #define TEST_DEBUG_LOG
  87. #define TEST_DEBUG_CHECK_DUP_SENDS
  88. #define TEST_DEBUG_TRACK_PACKET_LENS
  89. #define TEST_DEBUG_WORKAROUND1
  90. #define TEST_DEBUG_CARD_BAD
  91. #define TEST_DEBUG_CARD_TESTS
  92. //
  93. // This is not a debug build, so make everything quiet.
  94. //
  95. #define IF_LOUD(A)
  96. #define IF_VERY_LOUD(A)
  97. #define IF_LOG(A)
  98. #define IF_INIT(A)
  99. #define IF_TEST(A)
  100. #endif // DBG
  101. NTSTATUS
  102. DriverEntry (
  103. IN PDRIVER_OBJECT pDriverObject,
  104. IN PUNICODE_STRING pszuRegistryPath);
  105. VOID
  106. StreamIPFreeMemory (
  107. PVOID pvToFree,
  108. ULONG ulSize
  109. );
  110. NTSTATUS
  111. StreamIPAllocateMemory (
  112. PVOID *ppvAllocated,
  113. ULONG ulcbSize
  114. );
  115. NTSTATUS
  116. StreamDriverInitialize (
  117. IN PDRIVER_OBJECT DriverObject,
  118. IN PUNICODE_STRING RegistryPath
  119. );
  120. #endif // _MAIN_H
  121.