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.

74 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. trace.h
  5. Abstract:
  6. This is the header file that describes the constants, data structures
  7. and procedure prototypes used by the general purpose trace. The trace package
  8. is a debug facility for generating arbitrary events into a circular buffer.
  9. The debugger than has a !trace command to dump out the last N events from a
  10. trace buffer.
  11. Author:
  12. Steve Wood (stevewo) 11-Apr-1994
  13. Revision History:
  14. --*/
  15. #define RTL_TRACE_MAX_ARGUMENTS_FOR_EVENT 8
  16. typedef struct _RTL_TRACE_RECORD {
  17. ULONG Size;
  18. USHORT EventId;
  19. USHORT NumberOfArguments;
  20. ULONG Arguments[ RTL_TRACE_MAX_ARGUMENTS_FOR_EVENT ];
  21. } RTL_TRACE_RECORD, *PRTL_TRACE_RECORD;
  22. typedef struct _RTL_TRACE_BUFFER {
  23. ULONG Signature;
  24. USHORT NumberOfRecords;
  25. USHORT NumberOfEventIds;
  26. PRTL_TRACE_RECORD StartBuffer;
  27. PRTL_TRACE_RECORD EndBuffer;
  28. PRTL_TRACE_RECORD ReadRecord;
  29. PRTL_TRACE_RECORD WriteRecord;
  30. PCHAR EventIdFormatString[ 1 ];
  31. } RTL_TRACE_BUFFER, *PRTL_TRACE_BUFFER;
  32. #define RTL_TRACE_SIGNATURE 0xFEBA1234
  33. #define RTL_TRACE_FILLER_EVENT_ID 0xFFFF
  34. #define RTL_TRACE_NEXT_RECORD( L, P ) (PRTL_TRACE_RECORD) \
  35. (((PCHAR)(P) + (P)->Size) >= (PCHAR)(L)->EndBuffer ? (L)->StartBuffer : \
  36. ((PCHAR)(P) + (P)->Size) \
  37. )
  38. NTSYSAPI
  39. PRTL_TRACE_BUFFER
  40. RtlCreateTraceBuffer(
  41. IN ULONG BufferSize,
  42. IN ULONG NumberOfEventIds
  43. );
  44. NTSYSAPI
  45. void
  46. RtlDestroyTraceBuffer(
  47. IN PRTL_TRACE_BUFFER TraceBuffer
  48. );
  49. NTSYSAPI
  50. void
  51. RtlTraceEvent(
  52. IN PRTL_TRACE_BUFFER TraceBuffer,
  53. IN ULONG EventId,
  54. IN ULONG NumberOfArguments,
  55. ...
  56. );