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.

139 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. filtqtrace.h
  5. Abstract:
  6. This module contains public declarations and definitions for tracing
  7. and debugging filter queues.
  8. Author:
  9. Michael Courage (mcourage) 11-Nov-2000
  10. Revision History:
  11. --*/
  12. #ifndef _FILTQTRACE_H_
  13. #define _FILTQTRACE_H_
  14. #if defined(__cplusplus)
  15. extern "C" {
  16. #endif // __cplusplus
  17. //
  18. // This defines the entry written to the trace log.
  19. //
  20. typedef struct _FILTQ_TRACE_LOG_ENTRY
  21. {
  22. USHORT Action;
  23. USHORT Processor;
  24. PEPROCESS pProcess;
  25. PETHREAD pThread;
  26. PUX_FILTER_CONNECTION pConnection;
  27. PIRP pIrp;
  28. ULONG ReadIrps;
  29. ULONG Writers;
  30. PVOID pFileName;
  31. USHORT LineNumber;
  32. } FILTQ_TRACE_LOG_ENTRY, *PFILTQ_TRACE_LOG_ENTRY;
  33. //
  34. // Action codes.
  35. //
  36. // N.B. These codes must be contiguous, starting at zero. If you update
  37. // this list, you must also update the corresponding array in
  38. // ul\ulkd\filt.c.
  39. //
  40. #define FILTQ_ACTION_QUEUE_IRP 0
  41. #define FILTQ_ACTION_DEQUEUE_IRP 1
  42. #define FILTQ_ACTION_START_WRITE 2
  43. #define FILTQ_ACTION_FINISH_WRITE 3
  44. #define FILTQ_ACTION_BLOCK_WRITE 4
  45. #define FILTQ_ACTION_WAKE_WRITE 5
  46. #define FILTQ_ACTION_BLOCK_PARTIAL_WRITE 6
  47. #define FILTQ_ACTION_WAKE_PARTIAL_WRITE 7
  48. #define FILTQ_ACTION_COUNT 8
  49. #define FILTQ_TRACE_LOG_SIGNATURE ((LONG)'gLqF')
  50. //
  51. // Manipulators.
  52. //
  53. PTRACE_LOG
  54. CreateFiltqTraceLog(
  55. IN LONG LogSize,
  56. IN LONG ExtraBytesInHeader
  57. );
  58. VOID
  59. DestroyFiltqTraceLog(
  60. IN PTRACE_LOG pLog
  61. );
  62. VOID
  63. WriteFiltqTraceLog(
  64. IN PTRACE_LOG pLog,
  65. IN USHORT Action,
  66. IN PUX_FILTER_CONNECTION pConnection,
  67. IN PIRP pIrp,
  68. IN PVOID pFileName,
  69. IN USHORT LineNumber
  70. );
  71. #if ENABLE_FILTQ_TRACE
  72. #define CREATE_FILTQ_TRACE_LOG( ptr, size, extra ) \
  73. (ptr) = CreateFiltqTraceLog( (size), (extra) )
  74. #define DESTROY_FILTQ_TRACE_LOG( ptr ) \
  75. do \
  76. { \
  77. DestroyFiltqTraceLog( ptr ); \
  78. (ptr) = NULL; \
  79. } while (FALSE)
  80. #define WRITE_FILTQ_TRACE_LOG( act, pcon, pirp ) \
  81. WriteFiltqTraceLog( \
  82. g_pFilterQueueTraceLog, \
  83. (act), \
  84. (pcon), \
  85. (pirp), \
  86. __FILE__, \
  87. __LINE__ \
  88. )
  89. #else // !ENABLE_FILTQ_TRACE
  90. #define CREATE_FILTQ_TRACE_LOG( ptr, size, extra )
  91. #define DESTROY_FILTQ_TRACE_LOG( ptr )
  92. #define WRITE_FILTQ_TRACE_LOG( act, pcon, pirp )
  93. #endif // ENABLE_FILTQ_TRACE
  94. #if defined(__cplusplus)
  95. } // extern "C"
  96. #endif // __cplusplus
  97. #endif // _FILTQTRACE_H_