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.

164 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1994 - 1995 Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. trace.h
  5. Abstract:
  6. This module defines the interface to the Mpeg API
  7. I/O trace facility.
  8. Author:
  9. Jeff East [jeffe] 6-Dec-1994
  10. Environment:
  11. Revision History:
  12. --*/
  13. #ifndef TRACE_H
  14. #define TRACE_H
  15. #include <windows.h>
  16. #include "mpegapi.h"
  17. //
  18. // Determine if tracing is wanted in this compilation.
  19. //
  20. // The rule is simple: if explicitly enabled, supply it.
  21. // Otherwise, provide it in checked builds, but not in free
  22. // builds.
  23. //
  24. #ifdef ENABLE_IO_TRACE
  25. #define TRACE 1
  26. #else
  27. #define TRACE DBG
  28. #endif
  29. //
  30. // The trace entry points expect an IoControl operation code. But some
  31. // operations are performed using operations other than IoControl. These
  32. // are traced using the following "pseudo-op-codes".
  33. //
  34. #define MPEG_PSEUDO_IOCTL_BASE 0x890U
  35. #define FILE_DEVICE_MPEG_PSEUDO 0x00008900U
  36. #define CTL_CODE_MPEG_PSEUDO(offset) CTL_CODE(FILE_DEVICE_MPEG_PSEUDO, \
  37. MPEG_PSEUDO_IOCTL_BASE + offset, \
  38. METHOD_BUFFERED, \
  39. FILE_ANY_ACCESS)
  40. #define IOCTL_MPEG_PSEUDO_CREATE_FILE (CTL_CODE_MPEG_PSEUDO (0))
  41. #define IOCTL_MPEG_PSEUDO_CLOSE_HANDLE (CTL_CODE_MPEG_PSEUDO (1))
  42. //
  43. // The trace entry points
  44. //
  45. #if TRACE
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. VOID
  50. TraceSynchronousIoctlStart (
  51. OUT DWORD *pCookie,
  52. IN DWORD Id,
  53. IN DWORD Operation,
  54. IN LPVOID pInBuffer,
  55. IN LPVOID pOutBuffer
  56. );
  57. VOID
  58. TraceSynchronousIoctlEnd (
  59. IN DWORD Cookie,
  60. IN DWORD Result
  61. );
  62. VOID
  63. TraceIoctlStart (
  64. IN DWORD Id,
  65. IN DWORD Operation,
  66. IN LPOVERLAPPED pOverlapped,
  67. IN LPVOID pInBuffer,
  68. IN LPVOID pOutBuffer
  69. );
  70. VOID
  71. TraceIoctlEnd (
  72. IN LPOVERLAPPED pOverlapped,
  73. IN DWORD Result
  74. );
  75. VOID
  76. TracePacketsStart (
  77. IN DWORD Id,
  78. IN DWORD Operation,
  79. IN LPOVERLAPPED pOverlapped,
  80. IN PMPEG_PACKET_LIST pPacketList,
  81. IN UINT PacketCount
  82. );
  83. VOID
  84. TraceSynchronousPacketsStart (
  85. OUT DWORD *pCookie,
  86. IN DWORD Id,
  87. IN DWORD Operation,
  88. IN PMPEG_PACKET_LIST pPacketList,
  89. IN UINT PacketCount
  90. );
  91. VOID
  92. MPEGAPI
  93. TraceDump (
  94. VOID
  95. );
  96. VOID
  97. MPEGAPI
  98. TraceDumpFile (
  99. IN PUCHAR pFileName
  100. );
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #else
  105. //
  106. // Tracing isn't enabled, so just define the the trace entrypoints
  107. // into oblivion.
  108. //
  109. #define TraceSynchronousIoctlStart(Cookie, eStreamType, Operation, pInBuffer, pOutBuffer)
  110. #define TraceSynchronousIoctlEnd(Cookie, Result)
  111. #define TraceIoctlStart(eStreamType, Operation,pOverlapped, pInBuffer, pOutBuffer)
  112. #define TraceIoctlEnd(pOverlapped, Result)
  113. #define TracePacketStart(eStreamType, Operation, pOverlapped, pBuffer, BufferSize)
  114. #define TracePacketsStart(eStreamType, Operation, pOverlapped, pPacketList, PacketCount)
  115. #define TraceSynchronousPacketsStart(pCookie, Id, Operation, pPacketList, PacketCount)
  116. #define TraceDump()
  117. #endif
  118. #endif // TRACE_H