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.

178 lines
4.5 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 _TEST_H
  26. #define _TEST_H
  27. #if DBG
  28. extern ULONG TestDebugFlag;
  29. #define TEST_DBG_NONE 0x00000000
  30. #define TEST_DBG_TRACE 0x00000001
  31. #define TEST_DBG_DETAIL 0x00001000
  32. #define TEST_DBG_INFO 0x00002000
  33. #define TEST_DBG_WARNING 0x00004000
  34. #define TEST_DBG_ERROR 0x00008000
  35. #ifdef DEBUG_EXTRAS
  36. #define TEST_DEBUG(_Trace, _Msg) \
  37. { \
  38. __int64 llTime = 0; \
  39. ULONG ulTime = 0; \
  40. NdisGetCurrentSystemTime ((PLARGE_INTEGER)&llTime); \
  41. ulTime = (ULONG) (llTime >> 2); \
  42. if (_Trace & TestDebugFlag) \
  43. { \
  44. DbgPrint ("%04X %08X %-10.10s %4d ", ulTime & 0xffff, _Trace, &__FILE__[2], __LINE__); \
  45. DbgPrint _Msg; \
  46. } \
  47. }
  48. #else
  49. #define TEST_DEBUG(_Trace, _Msg) \
  50. { \
  51. if (_Trace & TestDebugFlag) \
  52. { \
  53. DbgPrint _Msg; \
  54. } \
  55. }
  56. #endif // DEBUG_EXTRAS
  57. #define IF_TESTDEBUG(f) if (TestDebugFlag & (f))
  58. #define TEST_DEBUG_LOUD 0x00010000 // debugging info
  59. #define TEST_DEBUG_VERY_LOUD 0x00020000 // excessive debugging info
  60. #define TEST_DEBUG_LOG 0x00040000 // enable Log
  61. #define TEST_DEBUG_CHECK_DUP_SENDS 0x00080000 // check for duplicate sends
  62. #define TEST_DEBUG_TRACK_PACKET_LENS 0x00100000 // track directed packet lens
  63. #define TEST_DEBUG_WORKAROUND1 0x00200000 // drop DFR/DIS packets
  64. #define TEST_DEBUG_CARD_BAD 0x00400000 // dump data if CARD_BAD
  65. #define TEST_DEBUG_CARD_TESTS 0x00800000 // print reason for failing
  66. //
  67. // Macro for deciding whether to print a lot of debugging information.
  68. //
  69. #define IF_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_LOUD ) { A }
  70. #define IF_VERY_LOUD(A) IF_TESTDEBUG( TEST_DEBUG_VERY_LOUD ) { A }
  71. //
  72. // Whether to use the Log buffer to record a trace of the driver.
  73. //
  74. #define IF_LOG(A) IF_TESTDEBUG( TEST_DEBUG_LOG ) { A }
  75. extern VOID TESTLog(UCHAR);
  76. //
  77. // Whether to do loud init failure
  78. //
  79. #define IF_INIT(A) A
  80. //
  81. // Whether to do loud card test failures
  82. //
  83. #define IF_TEST(A) IF_TESTDEBUG( TEST_DEBUG_CARD_TESTS ) { A }
  84. #else
  85. //extern ULONG TestDebugFlag;
  86. #define TEST_NONE
  87. #define TEST_FUNCTIONS
  88. #define TEST_COMMANDS
  89. #define TEST_CONNECTIONS
  90. #define TEST_SCIDS
  91. #define TEST_LIST_ALLOCS
  92. #define TEST_POOL
  93. #define TEST_INDICATES
  94. #define TEST_ALLOCATION
  95. #define TEST_DEBUG(_Trace, _Msg)
  96. #define IF_TESTDEBUG(f)
  97. #define TEST_DEBUG_LOUD
  98. #define TEST_DEBUG_VERY_LOUD
  99. #define TEST_DEBUG_LOG
  100. #define TEST_DEBUG_CHECK_DUP_SENDS
  101. #define TEST_DEBUG_TRACK_PACKET_LENS
  102. #define TEST_DEBUG_WORKAROUND1
  103. #define TEST_DEBUG_CARD_BAD
  104. #define TEST_DEBUG_CARD_TESTS
  105. //
  106. // This is not a debug build, so make everything quiet.
  107. //
  108. #define IF_LOUD(A)
  109. #define IF_VERY_LOUD(A)
  110. #define IF_LOG(A)
  111. #define IF_INIT(A)
  112. #define IF_TEST(A)
  113. #endif // DBG
  114. extern PDRIVER_OBJECT pGlobalDriverObject;
  115. extern PADAPTER global_pAdapter;
  116. ////////////////////////////////////////////////////////////////
  117. //
  118. // This structure contains information about the driver
  119. // itself. There is only have one of these structures.
  120. //
  121. typedef struct _DRIVER_BLOCK
  122. {
  123. //
  124. // NDIS wrapper information.
  125. //
  126. PVOID NdisMacHandle; // returned from NdisRegisterMac
  127. PVOID ndishWrapper; // returned from NdisInitializeWrapper
  128. } DRIVER_BLOCK, * PDRIVER_BLOCK;
  129. NTSTATUS
  130. DriverEntry (
  131. IN PDRIVER_OBJECT pDriverObject,
  132. IN PUNICODE_STRING pszuRegistryPath);
  133. NTSTATUS
  134. NdisDriverInitialize (
  135. IN PDRIVER_OBJECT DriverObject,
  136. IN PUNICODE_STRING RegistryPath,
  137. IN PVOID *pNdishWrapper
  138. );
  139. #endif // _TEST_H